Regex: Groups and Ranges Cheat Sheet

.Any character except new line (\n)
(a|b)a or b
(?:…)Passive (non-c­apt­uring) group
[abc]Range (a or b or c)
[^abc]Not (a or b or c)
[a-q]Lower case letter from a to q
[A-Q]Upper case letter from A to Q
[0-7]Digit from 0 to 7
\xGroup/­sub­pattern number “­x”

Ranges are inclusive.

Leave a Reply

Your email address will not be published. Required fields are marked *