In particular, I would like to know if I can specify a built-in option in the template line that will enable multi-line mode. That is, as a rule, with multi-line regex mode, Python is activated as follows:
pattern = re.compile(r'foo', re.MULTILINE)
I would like to get a multi-line match by specifying it in the template line, instead of using the re.MULTILINE option. You can do this in Java with a built-in expression (? M). eg.
pattern = re.compile(r'(?m)foo')
Is this possible in Python, or do I need to use the re.M option? And anyway, is there a good link for inline template options in Python?
source share