> if
> . matches any character except newline (by default)
> then
> what can i use to match any character INCLUDING newline?

Use an 's' modifier.

Quote: If this modifier is set, a dot metacharacter in the pattern
matches all characters, including newlines. Without it, newlines are
excluded. This modifier is equivalent to Perl's /s modifier. A negative
class such as [^a] always matches a newline character, independent of
the setting of this modifier.

Example: preg_match("!<tag>(.*)</tag>!s",$string,$matches);

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

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to