Re: Re: Re: preg_match() returns false but no documentation why

From: Date: Thu, 31 May 2007 00:38:07 +0000
Subject: Re: Re: Re: preg_match() returns false but no documentation why
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-255887@lists.php.net to get a copy of this message
At 5/30/2007 05:08 PM, Jared Farrish wrote:
So what does the definition I posted mean for non-bracketed periods? Does it mean it will match anything but a line or return break character? How in practice is this useful?
Read the manual: Pattern Syntax http://www.php.net/manual/en/reference.pcre.pattern.syntax.php
.       match any character except newline (by default)
        ...
Full stop Outside a character class, a dot in the pattern matches any one character in the subject, including a non-printing character, but not (by default) newline. If the PCRE_DOTALL option is set, then dots match newlines as well. The handling of dot is entirely independent of the handling of circumflex and dollar, the only relationship being that they both involve newline characters. Dot has no special meaning in a character class. etc.
How do you test regex's against any known variants? I suppose I need to build a test function to make arbitrary strings and then test and print the results. I just don't know if my regex is going to be that great in practice.
rework - an online regular expression workbench by Oliver Steele http://osteele.com/tools/rework/ The RegEx Coach (a downloadable Windows application) by Edi Weitz http://weitz.de/regex-coach/ Regards, Paul __________________________ Paul Novitski Juniper Webcraft Ltd. http://juniperwebcraft.com

« previous php.general (#255887) next »