Due to requirements of python's re module to allow going back into the input it consequently doesn't provide a possibility to pass anything else than a string as an argument to central functions of re (anything else wouldn't make a lot of sense if any). It is theoretically possible to implement regular expression matching based on streams if the backwards navigation isn't required and my question is now whether that has happened already and the results made available as FLOSS library. The only application I'm interested in is returning the positions of a found match.

I found regex 2014.10.24 (https://pypi.python.org/pypi/regex) and re2 0.2.20 (https://pypi.python.org/pypi/re2/) don't seem to support such features according to their project descriptions.

1 Answer 1



A Python library for parsing, compiling, and executing regular expressions. All searches execute in linear time with respect to the size of the regular expression and search text.

Streams are supported (i.e: network and files)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.