|
|
Basic Rules: Sets
-
Sets
- A set is defined using square brackets ([]).
- A range is a set which uses a dash to seperate the start of the range and the end.
- [0-9] = 0-9 inclusive
- [a-z] = a-z inclusive
- To specify a dash in a set it must be the first or last character.
- A range does NOT loop around. The first item in a range MUST be of a lower ASCII value than the second.
- [9-1] = error as 9 is after 1 in ascii
- to negate a set, have the first character (before a dash) as a carat(^)
- [^a-z] = Not a-z
- [^-0-9] = Not a dash or 0-9
- any special character that is not special within a set is automatically escaped.
- The only special characters within a range are ^ and -
|
|
|