View Single Post

  #2 (permalink)  
Old 07-16-2003
stephan beal
 
Posts: n/a
Default Re: Regex to match ALL characters?

Linda Patterson wrote:
> I read that the character '.' matches all characters except for a \n (new
> line) so I have the httpd.conf file in a string and I've replaced all the
> \n's with "@NL@" so there's no \n's to trip up the '.'


Don't do that. Use the 'm' option for preg_match, which makes . match a \n.

http://www.php.net/manual/en/ref.pcre.php
http://www.php.net/manual/en/pcre.pattern.modifiers.php

--
----- stephan beal
Registered Linux User #71917 http://counter.li.org
I speak for myself, not my employer. Contents may
be hot. Slippery when wet. Reading disclaimers makes
you go blind. Writing them is worse. You have been Warned.

Reply With Quote