I have been running into a problem with python's re module.
This is the simplest version of the issue
import re
print re.findall('a|ab','aab') # ['a', 'a']
print re.findall('ab|a','aab') # ['a', 'ab']
I generate regexes at runtime from a text file and cannot be certain that they will be in the correct order. Is there any way around this issue?