Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2003-11-18 00:19:30

Eric Niebler <eric_at_[hidden]> wrote:
> Brian McNamara wrote:
>> I agree that it is desirable to be able to _statically_ (at
>> compile-time) analyze and "compute on" regexps.
>> The main disadvantage is that it forces us to write regexps "ugly":
>> +(_1 = "hello ") >> "world"
>> rather than "pretty":
>> regexp("(hello )+world")
> Some would say regular expressions are ugly any way you look at them.
> :-) As an expression template, you can use whitespace, indenting and
> comments to make your regular expression more readable. Beauty is in the
> eye of coder.

Same here. I dislike REs a lot. It gives me a mild headache whenever I have
to read understand one. "(hello )+world" is ok--It's the more complex stuff
that gives me an eye strain. For instance, from the regex manual:
 "\\A(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})\\z". I really hate
those escapes. I also hate the fact that you can't format the code and
sprinkle it with whitespace. The ugliness of the RE syntax is one of the
motivating forces that made me write Spirit.


Joel de Guzman

Boost list run by bdawes at, gregod at, cpdaniel at, john at