compile-time regex redux

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Wed Feb 7 18:00:46 PST 2007


Bill Baxter wrote:
[snip]
> I my opinion about regexps is that they're too dense and full of 
> abbreviations.  And the typical methods for creating them don't 
> encourage encapsulation and abstraction, which are the foundations of 
> software.  For instance, every time you look at the above you have to 
> re-interpret what [A-Z0-9._%-] really means.  When I'm writing regular 
> expressions I always have to have that chart next to me to remember all 
> those \s \b \w \S \W \ codes, and then again when trying to figure out 
> what the code does later.  There has to be a better way.  Apparently the 
> Perl guys thing so too, because they're redoing regular expressions 
> completely for Perl 6.

(Well not completely.) That's why we should keep a close eye on those. 
The Perl community is much more experienced with regex usage than me and 
possibly yourself. I just want us to not delude ourselves with the idea 
that we could just sit down and write a better regex syntax just because 
we don't remember what \s and \b mean. (I happen to remember. :o))


Andrei



More information about the Digitalmars-d mailing list