Thread: REGEX question
View Single Post

  #6 (permalink)  
Old 03-09-2008
Tim Roberts
 
Posts: n/a
Default Re: REGEX question

Feijó <afeijo@gmail.com> wrote:
>
>Him Tim, Thanks!
>
>Thats wierd, your code works on my pspad regex search (if found a
>example I type in my source-code), but when I run over php, this error
>is returned:
>
>Warning: preg_match_all() [function.preg-match-all]: Delimiter must
>not be alphanumeric or backslash
>
>You know why?


Rik posted the answer to this, but I'd like to take this opportunity to put
in a recommendation for an excellent and somewhat underappreciated book:
Jeffrey Friedl's "Mastering Regular Expressions".

I got the book originally on a whim, thinking "what could he possibly have
to say about regular expressions that would take a whole book", but I find
that I have referred to it again and again. It is an excellent and
thorough treatise on the subject. The third edition even includes a
45-page chapter on PHP.

And as a bonus, he includes a regular expression that matches every legal
RFC 822 email address. It is several tens of thousands of characters long.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Reply With Quote