JBEHAVE-924 - Faster regex in pattern variant bulder

Changes for 924 on 4.x branch