[os_regex] do not use static maps

Static variables in headers are instantiated in every single source file, which includes the specific header. So this causes unnecessary memory consumption.