Regex Tester

Test regular expressions with live highlighting, match groups, and a pattern cheatsheet.

No data leaves your browser
Pattern
/
Test String
Common Patterns — click to use

How to use the Regex Tester

  1. Type a regular expression and choose flags (g, i, m, s, u).
  2. Paste test text; matches and capture groups highlight live.
  3. Check the match list and group values.
  4. Use the cheat sheet tab for syntax reminders.

Why use this Regex Tester

  • Live JavaScript regular expression testing
  • Highlights every match and capture group
  • Flags for global, case-insensitive, multiline and dotAll
  • Built-in regex cheat sheet

Frequently Asked Questions

Is the regex tester free?

Yes, completely free with no account or signup required.

Which regex flavor is used?

JavaScript's built-in RegExp (ECMAScript standard) with flags: global (g), case-insensitive (i), multiline (m), and dotAll (s).

What features are included?

Live match highlighting, capture group extraction, match count, a regex cheat sheet, and one-click patterns for common use cases.

What is a regular expression?

A regular expression (regex) is a sequence of characters that defines a search pattern. It is used to find, match, validate, and transform text in programming languages, editors, and command-line tools.

How do I test a regex online?

Enter your pattern in the Pattern field and your test string in the Text field. Matches are highlighted in real time as you type.

What are regex flags?

Flags modify how the pattern matches. g (global) finds all matches instead of stopping at the first. i (case-insensitive) treats uppercase and lowercase as equal. m (multiline) makes ^ and $ match line starts/ends. s (dotAll) makes . match newlines.

What is the difference between greedy and lazy quantifiers?

Greedy quantifiers (*, +, {n,m}) match as much as possible. Lazy quantifiers (*?, +?, {n,m}?) match as little as possible. For example, <.+> greedily matches a whole string, while <.+?> lazily matches the shortest possible span.

What is a capture group?

A capture group is part of the pattern wrapped in parentheses (). The matched text is extracted separately. Named groups use (?<name>...) syntax.

How do I match an email address with regex?

A common email pattern is [a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,}. Click the Email pattern in the cheat sheet to use it instantly.

What is a lookahead in regex?

A lookahead asserts that a pattern must (or must not) follow the current position without consuming characters. (?=...) is a positive lookahead and (?!...) is a negative lookahead.

How do I match the start or end of a line?

Use ^ to match the start and $ to match the end. Enable the m flag to make ^ and $ match the start and end of each individual line rather than the whole string.

More Developer Tools

JSON ToolsValidate, repair, compare & JSONPath JSON FormatterPretty-print and beautify JSON CSV Viewer & EditorView, edit and convert CSV files YAML ConverterConvert YAML to JSON and back Regex TesterTest regular expressions live Text DiffCompare two texts side by side JWT ToolDecode, encode, compare and verify JWTs JWT DecoderInspect JWT header and payload XML FormatterFormat, validate and convert XML URL EncoderEncode, decode and parse URLs Base64Encode and decode Base64 strings Hash GeneratorSHA-256, MD5, HMAC and CRC32 SHA-256Generate SHA-256 checksums MD5 GeneratorGenerate MD5 hash values Text ToolsCase convert, count and transform text Number ConverterBinary, hex and octal converter Token CalculatorEstimate LLM token counts from text PDF EditorEdit text, sign and annotate PDFs Schema GeneratorJSON to TypeScript, Go, Rust, Python IndexNowSubmit URLs to Bing, Yandex & more PII RedactorMask personal data & keys before AI Timestamp ConverterUnix epoch to date and back UUID GeneratorUUID v4/v7, ULID, Nano ID Password GeneratorSecure passwords & passphrases MCP Config BuilderConfigs for Claude, Cursor, VS Code AGENTS.md GeneratorCLAUDE.md, Cursor rules, Copilot AI Crawler Controlsrobots.txt for AI bots & llms.txt Cron ParserExplain crontab, next run times SQL FormatterBeautify & minify SQL queries cURL ConvertercURL to fetch, Python, Go, PHP Chat Export ConverterChatGPT/Claude export to Markdown Markdown PreviewLive GFM preview & to HTML Color & ContrastHEX/RGB/OKLCH, WCAG checker QR Code GeneratorURL, Wi-Fi, vCard; PNG & SVG Image EditorConvert, compress, resize & crop Tool Schema ConverterOpenAI ↔ Anthropic ↔ Gemini ↔ MCP JSONL ValidatorFine-tuning & batch files SSE Stream ParserReassemble LLM streaming responses Prompt Template & DiffFill {{vars}}, compare versions