Regex Tester
Write a pattern, see matches highlight as you type, and inspect every capture group instantly.
How Regex Tester works
Test regular expressions live with highlighted matches, capture groups and a replace preview. Everything happens inside this page: the tool reads your input, runs the calculation or conversion locally, and hands the result back to you. Nothing is transmitted, because there is no backend to transmit it to.
That design choice is deliberate. Most free tool sites upload your files to a server, process them there, and quietly keep a copy. Toolcin cannot do that — the site is a set of static files. If your connection dropped the moment the page finished loading, every tool would still work.
What the tester shows
Type a pattern, paste sample text, and every match is listed with its capture groups. The flags row controls how the engine behaves, and the replacement field previews a substitution using $1, $2 and the rest.
With the global flag on, every match is collected; with it off, only the first match is returned — which is exactly how the same pattern behaves in JavaScript, so the difference is visible rather than surprising.
The five flags, in plain terms
Flags change the meaning of the pattern, not just its speed. Mixing them up is the most common reason a regex “works on regex101 but not in my code”.
| Flag | Effect | Bites you when |
|---|---|---|
| g | Find all matches, not just the first | You forget it and wonder why only one result appears |
| i | Case-insensitive | You rely on case to separate tokens |
| m | ^ and $ match at line breaks | You expect them to mean start and end of the whole text |
| s | Dot also matches newlines | You parse multi-line input and stop at the first line |
| u | Full Unicode mode | You use emoji or non-Latin scripts |
Greedy, lazy and catastrophic backtracking
A quantifier is greedy by default: .* takes as much as it can and then gives characters back until the rest of the pattern matches. Adding ? makes it lazy, so it takes as little as possible — the difference between matching a whole line and matching one tag.
Nested quantifiers such as (a+)+ are the classic way to hang an engine. On a short string they are fine; on a 10,000-character line they can take minutes. If a test seems to freeze, that is usually the cause, and the fix is almost always to anchor the pattern or replace nesting with a simpler expression.
Replace preview and why it matters
The replacement field runs String.replace with your pattern, so the preview shows the real output rather than an approximation. That catches the common mistakes early: forgetting that $& means the whole match, or that a literal dollar sign must be escaped as $$.
Special characters have to be escaped to be literal. A dot matches any character; \. matches a dot. A slash inside a character class is literal, but a slash in a URL pattern outside one needs escaping if you are writing a literal regex in code.
Good to know
- Works offline once loaded, including on flights and in locked-down networks.
- No file size limit beyond your device's own memory.
- Free to use, with no account and no usage counter.
- Results are produced locally, so they are not logged or shared with anyone.
Questions
Which flags are supported?
Global, case-insensitive, multiline, dotAll, unicode and sticky — the standard JavaScript flags.
Will a bad pattern freeze the page?
Very heavy backtracking patterns can be slow; the tool warns you when a run takes unusually long.
Does it support lookbehind?
Yes if your browser does — modern Chrome, Edge, Firefox and Safari all support (?<=...) and (?<!...). There is no compatibility check, so test in the oldest browser you support.
Is my test text sent anywhere?
No. Matching runs in the page with the browser's own engine.
Keep going
More developer tools
Cron Parser
Turn a five-field cron expression into a readable description with the next five scheduled runs in your timezone.
Open toolHTML Formatter
Indent nested HTML so the structure is readable, without changing any markup.
Open toolCSS Minifier
Strip comments and whitespace from CSS and see exactly how many bytes you saved.
Open toolJSON Array to Text
Flatten a JSON array into one value per line. Objects inside the array are written as compact JSON on their own line.
Open toolJSON Minifier
Compress JSON by removing every unnecessary space and newline. Whitespace is insignificant in JSON, so minifying never changes meaning — the size saving is shown.
Open toolCSS Formatter
Re-indent minified CSS into readable rules and declarations. Each selector gets its own block and each declaration its own line.
Open tool