- Denoted by
[]
- [ae] -> matches an 'a' and an 'e', not multiple:
- i.e. gr[ae]y will match
grey
andgray
- i.e. gr[ae]y will match
- [a-z] -> hyphen specifies a range of characters:
- i.e. [0-9] matches a single digit
- i.e.2 [a-f] matches a char in a-f
- [a-z0-9A-F] -> groups of hyphen specifies a group of ranges
- qx -> caret after openning bracket negates the character class:
- i.e. qX matches
qu
inquestion
- i.e. must write it at the front of a class/set
- i.e. qX matches
Regex
· 4 min read