Re: [PHP] Re: Re: preg_match() returns false but no documentation why



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 .



Relevant Pages

  • Small Correction to K&R Exercise 1-22 Solution on CLC-Wiki
    ... lines after the last non-blank character that occurs before the n-th ... int t,len; ... This space will be replaced by a newline, ...
    (comp.lang.c)
  • Re: Problem with embedded carriage returns
    ... Under Windows, it is, in fact, a pair of characters comprising a Carriage Return character and a Line Feed character in that sequence. ... If what you describe is correct then the 'newline' imbbeded between quotes is not a 'newline' at all. ... I further suspect that where the imbeded 'newline' should have been, Notepad would have shown an 'unprintable' character which looks like a hollow rectangle. ... There are actually some 19 columns of data but when a StreamReader.ReadLine method tries to read line by line, it only returns data up to the first embedded newline chars. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Small Correction to K&R Exercise 1-22 Solution on CLC-Wiki
    ... Your fix looks correct to me at least. ... I don't think that overwriting the n-th character with a ... int t,len; ... ** to the foldarea with a newline. ...
    (comp.lang.c)
  • Re: [PHP] CSV Files
    ... After I right out the column headers do I have to put a '/n' to have it start a new line in the CSV file? ... refer to a newline character. ... rather than chrin PHP, ... character at the end of every row in CSV including the header row. ...
    (php.general)
  • Re: Small Correction to K&R Exercise 1-22 Solution on CLC-Wiki
    ... Your fix looks correct to me at least. ... I don't think that overwriting the n-th character with a ... int t,len; ... ** to the foldarea with a newline. ...
    (comp.lang.c)