Searchlight
Tools
BlogAbout
Free SEO Audit
Back to home
๐Ÿ“ˆSEO & Analytics
๐Ÿ—‚๏ธText & Data
๐Ÿ”Encoders & Decoders
โšกGenerators
๐Ÿ”„Converters
๐Ÿ–ผ๏ธImage Tools
๐Ÿ“„PDF Tools
๐Ÿ’ปCode Tools
๐Ÿ”Regex & Parsing
Regex TesterRegex VisualizerRegex CheatsheetCron Tester
๐ŸงฎCalculators
๐Ÿ—บ๏ธDiagrams
๐ŸŒNetwork & Web
โœ๏ธText Utilities
๐ŸŽจColor Tools
๐Ÿ”€Diff & Compare
156+ tools. OAuth is read-only.
Searchlight

156+ free SEO, developer, image, PDF, and productivity tools - no account needed.

Free ยท all tools included
Company
  • Blog
  • About
  • Free SEO Audit
Legal
  • Privacy Policy
  • Terms of Service
  • Cookie Policy

ยฉ 2026 Searchlight. All rights reserved.

Read-only OAuth ยท No data reselling ยท Completely free

Regex Tester

Test regular expressions live. All matches are highlighted as you type.

//
7 matches
Hello world! Test 123 and test@email.com
1Helloindex 0
2worldindex 6
3Testindex 13
4andindex 22
5testindex 26
6emailindex 31
7comindex 37

About this tool

Test and debug regular expressions in real time with live match highlighting, capture group display, and a flags selector. Write your regex, enter your test string, and see every match highlighted as you type. Supports all JavaScript regex syntax including lookaheads, lookbehinds, named capture groups, and Unicode mode.

How to Test a Regular Expression Online

  1. 1Enter your regular expression in the Regex field (without / delimiters).
  2. 2Select the flags you need (g for all matches, i for case-insensitive, etc.).
  3. 3Type or paste your test string in the Test String area.
  4. 4Matches are highlighted in real time as you type.
  5. 5Review capture groups and match positions in the results panel.

Frequently Asked Questions

What regex flavour does this tool use?+
JavaScript's built-in RegExp engine. This is compatible with most modern languages, though some advanced features (like possessive quantifiers) are JS-specific.
What do the flags g, i, m, s, u, d mean?+
g = global (find all matches, not just first), i = case-insensitive, m = multiline (^ and $ match line starts/ends), s = dotAll (. matches newlines), u = Unicode mode, d = generate match indices.
How do I test for an exact string match?+
Use ^ and $ anchors: ^your exact string$. Without anchors, the regex will match your string anywhere in the text.
How do I match an email address with regex?+
A simple pattern: [a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}. For production use, HTML's built-in email validation (type='email') or a library is more reliable.
What is the difference between a lookahead and a lookbehind in regex?+
A lookahead (?=...) checks what follows the current position without consuming characters. A lookbehind (?<=...) checks what precedes the current position. Negative versions (?!...) and (?<!...) assert the opposite. Both are zero-width assertions - they match a position, not characters.
What is the difference between greedy and lazy quantifiers?+
Greedy quantifiers (*, +, ?) match as many characters as possible. Lazy quantifiers (*?, +?, ??) match as few as possible. On the string 'a1b2c3', the greedy pattern \d+ matches all digits in sequence; a lazy variant stops at the first digit match.
What are some common regex patterns I should know?+
Email: [\w.+-]+@[\w-]+\.[\w.]+. URL: https?://[\S]+. Phone (US): \(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}. IP address: \d{1,3}(\.\d{1,3}){3}. Postcode (UK): [A-Z]{1,2}\d[A-Z\d]?\s?\d[A-Z]{2}.
How does regex work differently in JavaScript versus Python?+
JavaScript regex is built into the language - patterns use literal syntax (/pattern/flags) or RegExp objects. Python uses the re module with raw strings (r'pattern'). Key differences: Python supports named groups as (?P<name>...) and lookbehinds are fixed-width only in Python's re module. JavaScript added lookbehinds in ES2018.
Can complex regex patterns hurt performance?+
Yes. Catastrophic backtracking occurs when a pattern with nested quantifiers can match the same characters in exponentially many ways on a non-matching input. For example (a+)+ on a long non-matching string. Use possessive quantifiers or atomic groups where available, and test performance with long inputs.
Looking for a deeper guide on this topic? Browse the Searchlight blog.
Visit the blog โ†’

Related tools

View all Regex & Parsing โ†’
Regex VisualizerVisual diagram of regex structureRegex CheatsheetQuick reference for regex syntaxCron TesterTest cron expressions with next-run preview