Navigation menu

WoW:Pattern matching: Difference between revisions

Jump to navigation Jump to search
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.
* %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.
* [^set] --- represents the complement of set, where set is interpreted as above.
* [^set] --- represents the complement of set, where set is interpreted as above.


Anonymous user