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

Jesse Phillips jessekphillips+D at gmail.com
Thu Feb 3 14:03:54 PST 2011


Alex Folland Wrote:


> The problematic string:
> 
> Guaton_at_9min59sec.WAgame

Might I suggest using a simpler regex? It gives the ability to do better error checking/reporting. Instead of adding all the misspellings for minute and second, just capture those locations as words and analyze them outside the regex. In fact you could capture the whole time segment and use a second regex to pull out the data:

regex("(\d+\w+)", "g")

Then your regex isn't updated when you need to add hours and such.



More information about the Digitalmars-d-learn mailing list