Open gachteme opened 5 years ago
I'm a little hesitant to use a non-standard regex parser here, as it constrains textfsm too much. In particular, we are planning to port to other languages which are compatible with the same templates. Use of a regexp engine that is not RE2 compliant (and only RE2 compliant) will jeopardise those plans.
The regex module is (and plans to be) fully backwards compatible with re. It does allow for some extra functionality, and doesn't python's re already support lookaheads/lookbehinds (?=re) which are not supported by RE2? I can see a reason to be hesitant with using any third-party packages though. If absolute consistency (IE: throwing errors when something is supported in the language used but not all supported languages) between languages is desired a check could be added for regex RE2 compliance.
My bad, you meant it to apply to the multiple captures portion that was being leveraged. I'll do some checking to see if this is doable with pyre2.
According to https://github.com/google/re2/wiki/Syntax re2 would not be an option
~~I'm seeing the merge from #55 causes errors in python 2.7, is that no longer supported? If this is the case then~~ this should be ready for review. The only caveat is that I don't have an automated way of running the test suite with an environment containing the re module versus the regex module. I have manually run the tests in both environments.
Fixes #18
Instances of re were changed to regex. This allows for increased matching power. Repeated data parsing as asked for in issue #18 was added using the new regex module functionality. Test cases were updated to reflect the increased functionality and new option.