GeertDD wrote:
d11wtq wrote:
Character Matching
. (dot) ANY single character at all
Modifier Effect
s Ignore whitespace
Note that the above is not quite true.
The dot metacharacter does match any single character except for newlines.
I don't know exactly what you mean by 's modifier ignores whitespace'? Anyway, the s modifier just changes the meaning of the dot metacharacter which will then match newlines as well. Agree?
You're right of course Geert. Note that the author's "ignores white space (in the regex)" remark should belong to the x-modifier.
Some more inaccuracies:
\d, \s etc are what we refer to as "metacharacters"
Should be '\d, \s etc are what we refer to as "short hand character classes"'. Meta characters are: ., *, (, {, [, etc.
\d is a shorthand for [0-9], and [0-9] is a character class (or character set), hence: "short hand character class".
\w Any single alphanumeric character (a-z, 0-9) and underscores
Should be: "\w Any single alphanumeric character (a-z,
A-Z, 0-9) and underscores"
[x-y] Any single character in the range x to z (e.g. [A-Z])
A typo, I presume: this should be "[x-y] Any single character in the range x to
y (e.g. [A-Z])"