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

Benji Smith dlanguage at benjismith.net
Thu Feb 19 18:51:10 PST 2009


>> And how do you combine them? "repeat, ignorecase"? Writing and parsing 
>> such options becomes a little adventure in itself. I think the "g", 
>> "i", and "m" flags are popular enough if you've done any amount of 
>> regex programming. If not, you'll look up the manual regardless.
>>
> 
> Perhaps, string.match("a[b-e]", Regex.Repeat | Regex.IgnoreCase); might 
> be better? I don't find "gmi" immediately clear nor self-documenting.

I prefer the enum options too. But not vociferously. I could live with 
the single-char flags.

--benji



More information about the Digitalmars-d mailing list