359Dot matching newlines??
- Oct 31, 2007Hi,
PCRE lists it has a "dotall" mode that allows for the . character to
also match any sort of line feed / CRs also.
Is there a way to turn on this option in NTB5.5??
From the PCRE guide:
FULL STOP (PERIOD, DOT)
Outside a character class, a dot in the pattern matches any one
character in the subject string except (by default) a character that
signifies the end of a line. In UTF-8 mode, the matched character may
be more than one byte long.
When a line ending is defined as a single character, dot never matches
that character; when the two-character sequence CRLF is used, dot does
not match CR if it is immediately followed by LF, but otherwise it
matches all characters (including isolated CRs and LFs). When any
Unicode line endings are being recognized, dot does not match CR or LF
or any of the other line ending characters.
The behaviour of dot with regard to newlines can be changed. If the
PCRE_DOTALL option is set, a dot matches any one character, without
exception. If the two-character sequence CRLF is present in the
subject string, it takes two dots to match it.
The handling of dot is entirely independent of the handling of
circumflex and dollar, the only relationship being that they both
involve newlines. Dot has no special meaning in a character class.
- Next post in topic >>