JBEHAVE-924 - Faster regex in pattern variant bulder
(cherry picked from commit 0cea7fb79c505c280427477178f05afa454a0210)