WIP-fix pattern and flag regexes