WeUtils.uk

Regex tester

Enter a pattern and flags and test it against your text.

Free online regex tester

Test regular expressions against your own text in real time. Enter a pattern and flags (g, i, m, s, u), paste a test string, and see how many matches there are and what they capture. Great for validating emails, phone numbers, slugs and log parsing. It uses the JavaScript regex engine, so it matches what your front-end code will do.

FAQ

Which flags are supported? The standard JavaScript flags: g (global), i (ignore case), m (multiline), s (dotall), u (unicode). Is it private? Yes, matching runs entirely in your browser.

Common regex tokens (cheatsheet)

TokenMeaning
\ddigit (0-9)
\wword character
\swhitespace
\bword boundary
.any character
\nnewline
\rcarriage return
\ttab
*0 or more
+1 or more
?0 or 1
^ $start / end of string
[abc]any of a, b, c
a|ba or b
( )capturing group

Tip: use the m flag so ^ and $ match at the start and end of each line, and the s flag so . also matches line breaks (\n).