Regular Expression Tester

Form of Regular Expression

This free RegEX tester lets you test your regular expressions, just enter it below:

You can make use of $1, $2, $3 and so on if you are using parenthesis groups in your regular expression. \t \n \r are supported.

Your result can be seen below.

Result

About Regex Tester

What is Regular Expression?

A regular expression (regex or regexp for short) is a special text string for describing a search pattern. Regular expressions are used to perform pattern-matching and "search and replace" functions on text.

How it Works?

The Online Regex Tester tool who makes it possible to simultaneously test a regular expression on strings and to immediately view the results, including the captured elements. Enter your regular expression, source text(Test string) and click to the button "Check" and you will get result of RegEx Tester below in the result section.

Cheat Sheet

CharacterWhat does it do?
$ Matches the end of the input. If in multiline mode, it also matches before a line break character, hence every end of line.
(?:x)Matches "x" but does NOT remember the match. Also known as NON-capturing parenthesis.
(x)Matches "x" and remembers the match. Also known as capturing parenthesis.
*Matches the preceding character 0 or more times.
+Matches the preceding character 1 or more times.
.Matches any single character except the newline character.
?
  • Matches the preceding character 0 or 1 time.
  • When used after the quantifiers *, +, ? or {}, makes the quantifier non-greedy; it will match the minimum number of times as opposed to matching the maximum number of times.
[\b]Matches a backspace.
[^abc]Matches anything NOT enclosed by the brackets. Also known as a negative character set.
[abc]Matches any of the enclosed characters. Also known as a character set. You can create range of characters using the hyphen character such as A-Z (A to Z). Note that in character sets, special characters (., *, +) do not have any special meaning.
\
  • Used to indicate that the next character should NOT be interpreted literally. For example, the character "w" by itself will be interpreted as "match the character w", but using "\w" signifies "match an alpha-numeric character including underscore".
  • Used to indicate that a metacharacter is to be interpreted literally. For example, the "." metacharacter means "match any single character but a new line", but if we would rather match a dot character instead, we would use "\.".
\0Matches a NULL character.
\bMatches a word boundary. Boundaries are determined when a word character is NOT followed or NOT preceeded with another word character.
\BMatches a NON-word boundary. Boundaries are determined when two adjacent characters are word characters OR non-word characters.
\cXMatches a control character. X must be between A to Z inclusive.
\dMatches a digit character. Same as [0-9] or [0123456789].
\DMatches a NON-digit character. Same as [^0-9] or [^0123456789].
\fMatches a form feed.
\nMatches a line feed.
\rMatches a carriage return.
\sMatches a single white space character. This includes space, tab, form feed and line feed.
\SMatches anything OTHER than a single white space character. Anything other than space, tab, form feed and line feed.
\tMatches a tab.
\uhhhhMatches a character with the 4-digits hexadecimal code.
\vMatches a vertical tab.
\wMatches any alphanumeric character incuding underscore. Equivalent to [A-Za-z0-9_].
\WMatches anything OTHER than an alphanumeric character incuding underscore. Equivalent to [^A-Za-z0-9_].
\xA back reference to the substring matched by the x parenthetical expression. x is a positive integer.
\xhhMatches a character with the 2-digits hexadecimal code.
^
  • Matches the beginning of the input. If in multiline mode, it also matches after a line break character, hence every new line.
  • When used in a set pattern ([^abc]), it negates the set; match anything not enclosed in the brackets
x(?!y)Matches "x" only if "x" is NOT followed by "y". Also known as a negative lookahead.
x(?=y)Matches "x" only if "x" is followed by "y". Also known as a lookahead.
x|yMatches "x" OR "y".
{n,m}Matches the preceding character at least n times and at most m times. n and m can be omitted if zero..
{n}Matches the preceding character exactly n times.
Donate

Did you like this tool? You can donate to us. This will help us improve our free web tools.

Paypal