pygrok
pygrok copied to clipboard
Add support for re flags
When working with multiline strings, re requires extra flags in order to interpret new line characters differently.
e.g. https://docs.python.org/3/library/re.html#re.M
With this change you can optionally pass re flags when initalizing Grok objects.
grok = Grok(pat, flags=re.M|re.S)
I've successfully tested this change with both the re and regex package.