WoW:Pattern matching: Difference between revisions

m
→‎Constructing a pattern: I don't know how that little caveat was missed.
m (→‎Constructing a pattern: I don't know how that little caveat was missed.)
Line 27: Line 27:
* %x --- represents all hexadecimal digits.
* %x --- represents all hexadecimal digits.
* %z --- represents the character with representation 0. Note that embedded zeroes in a pattern will not work. Use this instead.
* %z --- represents the character with representation 0. Note that embedded zeroes in a pattern will not work. Use this instead.
The upper cased version of the above reverses the meaning of said (i.e. %A --- represents all ''non''-letters).
* %x (where x is any non-alphanumeric character) --- represents the character x. This is the standard way to escape the magic characters. Any punctuation character (even the non magic) can be preceded by a '%' when used to represent itself in a pattern.
* %x (where x is any non-alphanumeric character) --- represents the character x. This is the standard way to escape the magic characters. Any punctuation character (even the non magic) can be preceded by a '%' when used to represent itself in a pattern.
* [set] --- represents the class which is the union of all characters in set. A range of characters may be specified by separating the end characters of the range with a '-'. All classes %x described above may also be used as components in set. All other characters in set represent themselves. For example, [%w_] (or [_%w]) represents all alphanumeric characters plus the underscore.
* [set] --- represents the class which is the union of all characters in set. A range of characters may be specified by separating the end characters of the range with a '-'. All classes %x described above may also be used as components in set. All other characters in set represent themselves. For example, [%w_] (or [_%w]) represents all alphanumeric characters plus the underscore.
Anonymous user