Click here to Skip to main content
Click here to Skip to main content

Regex Quick Reference

, 25 Jun 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
A convenient Regex overview.

Characters - single character of a certain type


word character


non-word character










carriage return


line feed






character by hex value



Quantifiers - specify number of times to match


zero or one


n times


zero or more


n or more times


one or more

{n[4], m}

n to m times

Ranges - specify a range of accepted values

[ abc ]

a,b, or c

[^ abc ]

not a,b, or c


a, c, or anything in between


either a or c

Anchors - specify a certain position to match


word boundary


not word boundary


start of word


end of word


start of line


end of line

Assertions - match a pattern without consuming


positive look-ahead


negative look-ahead


positive look-behind


negative look-behind

Groups - multiple characters grouped together


group with back-reference


group with named back-reference


refer to a back-referenced group


group without back-reference

Modifiers - specify how the regex engine searches


case insensitive


case sensitive


dot matches newline


dot does not match newline


ignore pattern spacing


  • [1] a specific character’s hexadecimal value
  • [2] an integer greater than 0
  • [3] an integer greater than or equal to 0
  • [4] an integer greater than or equal to 0
  • [5] a RegEx pattern
  • [6] the index of a group in a RegEx pattern
  • [7] the index of a group in a RegEx pattern


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

JBH Works
United States United States
No Biography provided
Follow on   Google+   LinkedIn

Comments and Discussions

GeneralMy vote of 5 Pinmembergramacha26-Jun-13 3:51 
Questiongud article Pinmemberharshal768926-Jun-13 2:48 
QuestionAbout some example. Pinmembercsharpbd26-Jun-13 2:21 
QuestionBetter documentation-2 PinprofessionalPrasad Khandekar25-Jun-13 22:54 
QuestionA better documentation Pinmembermorgex25-Jun-13 22:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150129.1 | Last Updated 26 Jun 2013
Article Copyright 2013 by FrostedSyntax
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid