You're right of course Geert. Note that the author's "ignores white space (in the regex)" remark should belong to the x-modifier.GeertDD wrote:Note that the above is not quite true.d11wtq wrote:Code: Select all
Character Matching . (dot) ANY single character at all
Code: Select all
Modifier Effect s Ignore whitespace
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?
Some more inaccuracies:
Code: Select all
\d, \s etc are what we refer to as "metacharacters"
\d is a shorthand for [0-9], and [0-9] is a character class (or character set), hence: "short hand character class".
Code: Select all
\w Any single alphanumeric character (a-z, 0-9) and underscores
Code: Select all
[x-y] Any single character in the range x to z (e.g. [A-Z])