[Issue 7260] "g" on default in std.regex.match
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Feb 24 12:45:11 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7260
--- Comment #2 from bearophile_hugs at eml.cc 2012-02-24 12:45:08 PST ---
(In reply to comment #1)
> I dunno how to "fix" this bug. "g" by default imples there is a way to override
> it. regex("blah","") ?
> Leaving it as is now breaks old codebases that rely on "g" (though there should
> be more of legacy std.regexp code out there).
> Making it "g" on affects old code only inside foreach and generic constructs
> that show all matches or iterate on them, it's rare but non-zero.
>
> Another way would be to ditch current API, which I is not ideal btw ;)
Fully ditching the currently used API is probably too much.
A possible idea:
regex("blah") <<== repeat over the whole input.
regex("blah","") <<== repeat over the whole input.
regex("blah","g") <<== repeat over the whole input.
regex("blah","d") <<== doesn't repeat over the whole input.
So far you have done good work on the regular expression implementation, so I
trust your work. Thank you.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list