std.regex bug? My regex doesn't match what it's supposed to.

Alex Folland lexlexlex at gmail.com
Thu Feb 3 06:32:36 PST 2011


I figured something out, at least.  I had forgotten to use backslashes 
before the hyphens in the [...]s.  That makes the matches link together 
as expected, but it still doesn't make "s(ec(ond)?)?" match "sec" like 
it should.  It just matches "s".

For example, with std.regex, the following regex doesn't match the full 
string below it.

(\d+([\.\-\s_']|and|m(in(ute)?s?)?|s(ec(ond)?s?)?)*){1,3}
9min59sec24

It does match on http://regextester.com .  This is pretty clearly a bug 
at this point.  I don't see what else I could be doing wrong.


More information about the Digitalmars-d-learn mailing list