add pattern modifiers support to regexes