|
![](/i/fill.gif) |
Le 16/07/2012 12:28, Invisible a écrit :
> I don't like regular expressions. Or rather, I don't like the mangled
> ASCII pea-soup typically used to /represent/ regexes
Issue number 1: there is too many syntaxes for regexes.
SQL has its own. Unix ed/sed/vi... has another. Windows try to have some
but not all, and so on (including unix shells)...
(SQL uses % and ? where Unix classical uses * and . )
Regexes is useful for small items.
Trying to recognize a book from another with a regex is silly.
(I want a regex that catch all transcriptions in any language and any
encoding of the work of William Shakespeare but it should avoid all
other books, including the one talking about the work of William
Shakespeare... go to hell!)
Trying to implement a BNF syntax with a regex is asking for trouble as
soon as recursion or reordering is allowed. And interesting BNF syntax
have always a recursion somewhere (just to allow more than one item...),
and most are also cool about the required order of appearance of
sub-items or properties.
Regex for syntactically correct email address: yes
Regex for valid ip address: yes
Regex for validating your income's tax form: No way!
>. I have nothing
> against the formal /concept/ of a regular expression. I just dislike the
> lack of separation between commands and arguments. (And the fact that it
> looks like pea-soup!)
Command ?
There is no command in regexes. Commands are from a programming
language. They often make more issues with regexes too.
Post a reply to this message
|
![](/i/fill.gif) |