eliminate junk from std.string?

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Jan 10 18:30:59 PST 2011


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..


More information about the Digitalmars-d mailing list