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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux