Re: [PHP] Re: Re: preg_match() returns false but no documentation why
- From: paul@xxxxxxxxxxxxxxxxxxx (Paul Novitski)
- Date: Wed, 30 May 2007 17:38:07 -0700
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 .
- Prev by Date: Re: [PHP] Re: find (matching) person in other table
- Next by Date: Re: Re: Re: preg_match() returns false but no documentation why
- Previous by thread: find (matching) person in other table
- Next by thread: local v remote
- Index(es):
Relevant Pages
|