How to get the "longest possible" match with Python's RE module?
MonkeeSage at gmail.com
Tue Sep 12 07:19:05 CEST 2006
Licheng Fang wrote:
> Hi, according to these regexp engine discussions, it's NOT a behavior
> true to any implementation.
Well, I just double-checked in ruby (oniguruma regexp engine):
r = Regexp.new("do|dolittle")
r = Regexp.new("one(self)?(sufficient)?")
if ("doolittle" =~
if ("oneselfsufficient" =~
var r = new RegExp(/do|dolittle/);
var r = new RegExp(/one(self)?(selfsufficient)?/);
So, it seems they are all broken, or python is correct as well.
More information about the Python-list