Quote:
Originally Posted by Serpentine
(?s) is 'single line', it evaluates everything as a single line - as such .'s are not restricted to a single line, they will wrap. However if you are explicitly looking for \s's, those will also wrap around if you were not using single line, as they match the line break [\n\r].
In multiline (?m), you can use multiple [^$] to match the stard/end of lines, rather than the whole string.
As always, check out http://www.pcre.org/pcre.txt
It's surprisingly easy to read, just search around for a good starting point.
|
EDIT: WAAAAIT a minute. So are you saying that
.* doesn't include \s, \n, or \r, but
[^\.](for example) does? In other words, searches that use
. match everything except \n \s and \r, whereas searches that use
^ match every value (including \n, \r, and \s) except the value that follows it? I think (i hope) this is becoming slightly clearer. So then is there an expression that would search for the kind of string i'm looking for now but restrict the search to a single line of code? ie maybe something that uses
^ to negate
\n values?