Test JavaScript regular expressions live, with highlighted matches, capture groups, replace preview, plain-English explanations and code for eight languages.
Initializing in your browser…
Test XPath 1.0 expressions against XML as you type, with node-set, number, string and boolean results and automatic namespace prefixes.
Convert text to 17 case styles at once, including Title Case (Chicago, AP or APA), Sentence case, camelCase, snake_case and URL slugs, with one-click copy.
Count words, characters, sentences and paragraphs as you type, with reading time, six readability scores, an SEO checklist and keyword density.
A support team wants to pull every email address out of a block of pasted text, with the user name and the domain in separate columns for a spreadsheet.
Pattern, flags gi, and text
/(?<user>[\w.+-]+)@(?<domain>[\w-]+(?:\.[\w-]+)+)/gi Questions go to support@loopaloo.example, sales to sales.team@shop.example.co.uk. Old addresses like admin@legacy and @handle are not emails.
2 matches, 2 groups
#1 characters 16 to 40 support@loopaloo.example
user: support domain: loopaloo.example
#2 characters 51 to 80 sales.team@shop.example.co.uk
user: sales.team domain: shop.example.co.ukThe domain part requires at least one dot followed by more letters, so admin@legacy is skipped, and because the repeat is (?:\.[\w-]+)+ rather than a run of dots and letters, the full stop that ends the sentence after co.uk is not swallowed into the address. @handle has no user part, so it cannot match. Exporting as CSV gives one row per match with the two named groups as columns, ready to paste into a spreadsheet.
Type a regular expression and some text, and every match is highlighted as you type, with its position and each capture group listed. Replace with $1-style references, explain a pattern token by token, start from a library of common patterns, and copy working code for eight languages.
Regular expressions are compact and powerful and very easy to get slightly wrong. A tester shows you immediately what a pattern actually matches, which is the only reliable way to write one. This tester uses your browser's own JavaScript engine, so what you see is exactly what JavaScript, Node.js and TypeScript will do with the same pattern and flags.
Live matching with details. Matches are highlighted in the text as you type. Below, each match shows its start and end position and the value of every capture group, named groups by name. Empty matches (patterns that match a position, such as \b or a lookahead) are marked rather than silently skipped, and if a pattern can match zero characters it is still stepped through the text correctly, including past emoji. All seven user-facing flags are available: global, ignore case, multiline, dot matches newline, unicode, unicode sets (v) and sticky (y). Results can be exported as JSON or CSV.
Protection from runaway patterns. Some patterns, such as (a+)+$, take exponentially long on text that almost matches, a problem known as catastrophic backtracking. The matching runs in a background worker with a five-second limit, so instead of freezing the tab the tool stops the search and explains what kind of pattern causes it and how to fix it. A pattern that does not compile shows the browser's error and a hint, and the match count is left blank rather than shown as zero, because no search took place.
Replace, explain and build. The Replace tab previews a find-and-replace across the whole text. Choose whether $ signs are read as JavaScript replacement patterns ($&, $1, $<name>, $$) or inserted literally, which avoids surprises when the replacement contains a price. The explanation lists each part of the pattern in plain English, distinguishing an escaped character from a quantifier and a character class from a group. The Builder assembles a pattern from blocks, escaping any exact text you add, and the Library offers ready-made patterns for emails, URLs, dates, IP addresses, colours, file paths and more as starting points.
Code for other languages. The Code tab turns the current pattern into a runnable snippet for JavaScript, Python, Java, PHP, C#, Go, Rust or Ruby, with the pattern escaped correctly for that language and the flags translated into its own options. Where engines differ it adapts or warns: named groups become (?P<name>) in Python, PHP gets no g modifier (it has none), Ruby's m flag is used for dot-matches-newline, and Go and Rust snippets note that their engines do not support lookaround or backreferences. Patterns and recent history are stored only in your browser.
Develop a pattern for a postcode, product code or username against real examples, then copy it into your form validation code.
Paste a log file, write a pattern with named groups for the timestamp and status, and export every match as CSV.
Preview a bulk rename or reformatting, such as swapping "Last, First" to "First Last" with $2 $1, before running it in your editor.
Read the explanation of an inherited pattern to understand what each part does, and find out why it matches too much or too little.
The built-in example (?<user>[\w.+-]+)@(?<domain>[\w-]+(?:\.[\w-]+)+) with flags gi finds support@loopaloo.example and sales.team@shop.example.co.uk, with user and domain captured separately, and correctly ignores admin@legacy and @handle.
Pattern (\w+), (\w+) with replacement $2 $1 turns "Lovelace, Ada" into "Ada Lovelace" when $ signs are read as patterns; read literally, the result would contain the characters $2 $1.
Pattern (a+)+$ against thirty a characters followed by a b would run for minutes in most engines. Here the search stops after five seconds with an explanation of nested quantifiers.
JavaScript (ECMAScript), using the engine built into your browser. Results match what Node.js, Deno, TypeScript and browser code will do. Other languages are similar for everyday patterns but differ in details; the Code tab adapts the pattern where it can and warns where it cannot.
g finds every match rather than the first. i ignores case. m makes ^ and $ match at each line break. s lets . match newlines. u enables full Unicode handling and \p{...} property escapes. v is a newer, stricter form of u with set operations in character classes. y (sticky) only matches at the exact current position.
Check the flags first: without g only the first match is found, and without i case must match exactly. If ^ or $ are used on multi-line text, you probably need m. If the pattern is invalid, an error appears above the tabs and the count is left blank.
Some patterns, typically a repeated group that itself contains a repeat, such as (a+)+ or (\w+\s?)*, can take exponentially long when the text almost matches. The tester stops after five seconds instead of freezing. Rewrite the inner part so it cannot match the same text in more than one way, or anchor it.
In the Replace tab, with "With $ patterns" selected, $1 to $99 insert numbered groups, $<name> inserts a named group, $& inserts the whole match and $$ inserts a dollar sign. Choose "Exactly as typed" if your replacement contains dollar amounts that should not be interpreted.
They cover the common shapes and are a good starting point, but formats like email addresses and URLs are more varied than any short pattern can capture. For anything important, test with real data and rely on the receiving system for final validation.
No. Matching happens in a worker inside your browser. Recent patterns are saved in your browser's local storage on this device only, and the share link includes the test text only when it is short.
Your text is processed locally in the browser. Nothing you paste or open is transmitted or logged.