Regex Toolkit

Use the form below to test regular expressions. Enter a regular expression, some input text, and click the Match button. You can click the result to see where it matched in the input, and click the reference items below to enter them into the regex. For a good quick regex reference, see the Mozilla Developer Center.

Options:

Regular Expression

Search Text

Result

GroupSpanValue

Character Classes

  • .Any character except a newline
  • \dAny decimal digit
  • \DAny non-digit
  • \sAny whitespace character
  • \SAny non-whitespace character
  • \wAny word character
  • \WAny non-word character

Quantifiers

  • *0-∞ of the preceding block
  • +1-∞ of the preceding block
  • ?0 or one of the preceding block
  • {m}Exactly 'm' of the preceding block
  • {m,n}'m' to 'n' of the preceding block

Miscellaneous

  • |Alternation
  • [ ]Character set
  • ^Beginning of line
  • $End of line
  • \bA word boundary
  • \BNOT a word boundary

Grouping constructs

  • ( )A group
  • (?: )Non-capturing group
  • (?= )Positive lookahead assertion
  • (?! )Negative lookahead assertion
  • \nBackreference to the nth group



About The Author

Baron is the founder and CEO of VividCortex. He is the author of High Performance MySQL and many open-source tools for performance analysis, monitoring, and system administration. Baron contributes to various database communities such as Oracle, PostgreSQL, Redis and MongoDB.


Comments