Open harro opened 5 years ago
If breaking out, it would be great to get your interpretation of the potential solution. Hard for an outside reader to decompose based on title and reference alone.
support for capture of multiple matches per field per line.
example text to match:
key1:val1, key2:val2, key3:val3 ...
where the number of times this is repeated is arbitrary.
You would think to go about a match as so:
Value keys (\S+)
Value vals (\S+)
Start
^({keys}:{vals},\s?)+
but python re does not support this and would only give you key3 and val3.
Pull request adds a dependency to a different regex parsing module which has this functionality and is backwards compatible with re. Other solutions would include post processing (some functionality could be lost), or making repeated matches very general then going through the general match recursively as you strip layers of parenthesis, which would be ugly to implement.
There are examples and test cases in #38 if you want to see the functionality of some edge cases.
This is useful. Are you guys planning on merging this anytime soon?
Has there been any movement on this at all?
👀 still in future plans?
It's been a while but IIRC the blocker for this is template compatibility. As alternate implementations, such as golang (#64) uses a different regexp engine (or at least they did).
So if the python instance supports regexp functionality that is not a common denominator across implementations then the template libraries would need to be split, as different templates would be required depending on the textfsm instance.
As far as i can see the go implementation linked in the discussion isn't maintained, wouldn't there be more gains in mergin this?
Adding this would preclude using a common template library across implementations, not just the golang implementation above but any implementation (now or in future) that uses this different regexp implementation.
Breaking out from issue #18, with pull request #38