Is str ~ regex the root of all evil, or the leaf of all good?

Christopher Wright dhasenan at gmail.com
Fri Feb 20 04:20:11 PST 2009


Andrei Alexandrescu wrote:
> Christopher Wright wrote:
>> Your first example was:
>> auto match (char[] source, char[] pattern, char[] options);
>>
>> Your second example was:
>> auto match (char[] source, regex expression);
>>
>> The second is good, but more typing than you said originally. The 
>> first is problematic.
> 
> Why is it problematic? Is the name "match" too common?
> 
> Andrei

No. What is the difference between those two? One is building a regex 
internally and not letting me store it; and it forces me to pass two 
parameters rather than one. The other takes a regex as a parameter, 
which I can store, and I can set both options (the pattern and the match 
options) once for all.



More information about the Digitalmars-d mailing list