Mike Coleman wrote: [SNIP] > # alternative 2: > re.structmatch(r'xxx|(?=abc)', 'zzxxxabczz') --> ['zz', 'bbczz'] ^ > re.structmatch(r'xxx|(?=abc)', 'zzxxxbbczz') --> ['zz', 'bbczz'] > > # alternative 3: > re.structmatch(r'xxx|(?=abc)', 'zzxxxabczz') --> ['zz', '', 'bbczz'] ^ > re.structmatch(r'xxx|(?=abc)', 'zzxxxbbczz') --> ['zz', 'bbczz'] > I take it the first 'b' in both of the first examples for each alternative were supposed to be 'a'? And as for which version, I actually like Mike's version more than the one AMK and Tim like. The reason is that the '' in the middle of the example in question in the OP tells you where the split would have occurred had split0 (I like that or 'split_empty') not been turned on. That way there is no real loss of data between the two, but a gain with the new feature being used. -Brett
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4