Nick Sabalausky wrote:
"Andrej Mitrovic" <andrej.mitrov...@gmail.com> wrote in message
news:mailman.543.1294713068.4748.digitalmar...@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.
I agree.