LPS-48523 Fix unnecessary usages of regex
LPS-48523 Avoid uncessary compilations of regexes that have to be used
LPS-48523 Simplify one regular expression, and avoid recompliation of regexes