Logo

Regex Tester

Test regular expressions with instant visual feedback

Regular Expression

//g

Common Patterns

Sample Texts

0 Matches Found

Test Text

Highlighted Matches

No matches to display

Free Online Regex Tester — Test Regular Expressions Instantly

Regular expressions are one of the most powerful tools in a developer's toolkit. They let you search, match, and manipulate text using patterns. But writing the right regex can be tricky — a single misplaced character can change the entire behaviour. That is where a live regex tester becomes essential. Instead of running your code, deploying, and checking logs, you can test your pattern right here and see every match highlighted instantly.

This free Regex Tester supports all six JavaScript regex flags: global (g), case-insensitive (i), multiline (m), dotAll (s), unicode (u), and sticky (y). Type your pattern, paste your test string, and watch matches appear in real time. Every match is colour-coded and numbered. Capture groups are shown separately. You can also use the built-in replace mode to test find-and-replace operations.

Eight common patterns are built in — email, URL, phone number, hex colour, IP address, date, HTML tag, and plain numbers. Four sample texts are provided so you can test patterns instantly. All processing runs in your browser. No data is sent to any server.

Understanding Regex Flags

g — Global

Find all matches in the string, not just the first one. Without this flag, the regex stops after the first match.

i — Case-insensitive

Treat uppercase and lowercase letters as the same. "abc" matches "ABC", "Abc", and so on.

m — Multiline

Make ^ and $ match the start and end of each line, not just the start and end of the entire string.

s — DotAll

Make the dot (.) match newline characters as well. By default, dot matches everything except newlines.

u — Unicode

Enable full Unicode support. Required for matching emoji, CJK characters, and other multi-byte sequences correctly.

y — Sticky

Match only from the position indicated by lastIndex. Useful for tokenisation and lexer implementations.

Common Regex Patterns Explained

Email validation

[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} — Matches standard email addresses with alphanumeric local parts and domain names.

URL matching

https?://[\w\-]+(\.[\w\-]+)+[/#?]?.* — Matches HTTP and HTTPS URLs with domain names, paths, and query strings.

Phone numbers

\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4} — Matches US phone numbers in various formats: (123) 456-7890, 123-456-7890, 123.456.7890.

IP addresses

\b(?:\d{1,3}\.){3}\d{1,3}\b — Matches IPv4 addresses like 192.168.1.1. Does not validate range (0-255).

Dates

\d{4}-\d{2}-\d{2} — Matches dates in YYYY-MM-DD format. Does not validate month or day ranges.

HTML tags

<[^>]+> — Matches opening and closing HTML tags including self-closing tags. Not suitable for full HTML parsing.

Frequently Asked Questions

Is this regex tester free?+
Yes, completely free with no account, no ads, and no limits on usage.
Is my data sent to a server?+
No. All regex testing runs locally in your browser. Nothing is uploaded.
What regex engine does it use?+
JavaScript's built-in RegExp engine. All results match what you would get in Node.js or any browser.
Does it support capture groups?+
Yes. Capture groups are shown separately for each match with their index numbers.
Can I do find and replace?+
Yes. Toggle the Replace button to enter a replacement string. The result updates in real time.
What are the highlight colours?+
Five rotating colours are used to distinguish adjacent matches: amber, violet, pink, teal, and blue.
Can I copy the regex?+
Yes. Click "Copy Regex" to copy the pattern with flags in /pattern/flags format.
Does it work on mobile?+
Yes. The layout is fully responsive with a sidebar on desktop and stacked on mobile.
Advertisement
Logo

Your all-in-one digital toolkit with 100+ free online tools. Fast, secure, and always available when you need them.

Secure & Private

All processing happens locally in your browser

Mobile Friendly

Works perfectly on all devices and screen sizes

Always Free

No registration, no limits, completely free to use

100+
Free Tools
50K+
Daily Users
1M+
Tools Used
150+
Countries
© 2026 OmniWebKit. All rights reserved.
Made withfor developers and creators