Back to tools

RegExp

Regular Expression Tester

Test JavaScript regular expressions online with flags, capture groups, match lists, and highlighted matches in the text editor.

Expression

Test text

0

Matches

Common regular expressions

Email

^[^\s@]+@[^\s@]+\.[^\s@]+$

URL

https?:\/\/[^\s]+

Mobile phone

^1[3-9]\d{9}$

IPv4

^(25[0-5]|2[0-4]\d|1?\d?\d)(\.(25[0-5]|2[0-4]\d|1?\d?\d)){3}$

Date

^\d{4}-\d{2}-\d{2}$

HEX color

^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$

Regular expression rules

.Matches any character except line breaks; with s it also matches line breaks.
\d \DDigit / non-digit.
\w \WWord character / non-word character.
\s \SWhitespace / non-whitespace.
^ $Start and end of text; with m, start and end of each line.
* + ?Repeat 0+, 1+, or 0/1 times.
{n,m}Repeat from n to m times.
[abc] [^abc]Character set / negated set.
(...)Capture group, shown as $1, $2 in results.
(?:...)Non-capturing group.
a|bMatch a or b.
(?=...) (?!...)Positive / negative lookahead.