eliminate junk from std.string?

Walter Bright newshound2 at digitalmars.com
Tue Jan 11 11:25:56 PST 2011


Nick Sabalausky wrote:
> "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.

I agree.


More information about the Digitalmars-d mailing list