🔰character set
🚧 under construction
Last updated
🚧 under construction
Last updated
JS ⟩ value ⟩ object ⟩ regex ⟩ pattern ⟩ char set
synonyms: "character class"
Only ^ - \ ]
need to be escaped inside a character class.
As far as JavaScript’s regular expressions are concerned, a “word character” is only one of A-Z
, a-z
, 0-9
, and _
.
Things like é or β, will not match \w
(and will match \W
).
Within square brackets [x-y]
, a hyphen (-
) between two characters can be used to indicate a range of characters, where the ordering is determined by the character’s Unicode number.