Single Character

Special Character RE Description
New line \n New line
Next page \f Form feed
Return \r return
space \s space
table \t table
Vertical table \v Vertical tab
back [\b] Backspace


Special Character RE Description
Any character except new line .
[0-9], single number \d digit
Except [0-9] \D Not digit
[A-Z,a-z,0-9] \w Word
except [A-Z,a-z,0-9] \W Not word
Matches Unicode whitespace characters \s
any character which is not a whitespace character \S Not space

loop and repeat


? Means match 0 or 1 character. Like color and colour, our regular expression is: /colou?r/


Use *, means 0 or infinity character(s).