eliminate junk from std.string?
Nick Sabalausky
a at a.a
Mon Jan 10 19:20:42 PST 2011
"Andrej Mitrovic" <andrej.mitrovich at gmail.com> wrote in message
news:mailman.543.1294713068.4748.digitalmars-d at puremagic.com...
> Speaking of regex.. I see there are two enums in std.regex, email and
> url, which are regular expressions. Why not collect more of these
> common regexes? And we could pack them up in a struct to avoid
> polluting the local namespace. I think this might encourage the use of
> std.regex, since the average Joe wouldn't have to reach for the regex
> book whenever he's processing strings. E.g.:
>
> foreach(m; match("10abc20def30", regex(patterns.number))) //
> std.regex.patterns.number
> {
> writefln("%s[%s]%s", m.pre, m.hit, m.post);
> }
>
> Just a passing thought..
I think that's a great idea.
More information about the Digitalmars-d
mailing list