Fixed #2250

Fixed #2250 with #2271 
You're completely right, sorry I do most of my regex in js, where it would be necessary sometimes