Ruby\'s regular expressions have a feature called atomic grouping (?>regexp)
, described here, is there any equivalent in Python\'s re
module?
It would seem not.
http://www.regular-expressions.info/atomic.html
Atomic grouping is supported by most modern regular expression flavors, including the JGsoft flavor, Java, PCRE, .NET, Perl and Ruby.
You can emulate the non-capturing-ness of them by using non-capturing groups, (?:RE)
, but if I'm reading it right, that still won't give you the optimization benefits.