Test Regex Online

Free Online Regex Tester

Free online regex tester. Enter a pattern, set the flags, add sample text and select Execute Regex Test. The Match Results list shows every match with its index and capture groups.

Developer tools by OnlinePCApps since 2013

No upload Match list Groups and flags Free
0
Bytes uploaded
6
Regex flags
0
Files stored
$0
Free, always
Why test a regex

Online Regex Tester for Patterns, Logs and Validation

A regex that looks right can still miss a case or match too much. The free online regex tester runs it against sample text and lists every match with its index and groups.

Build a Pattern Step by Step

Writing a regex blind and hoping it works is slow. Run the pattern in the online regex tester, check the match list and edit. Add one token at a time and run again, so every change shows its effect on real text.

A pattern shaped one run at a time.

Catch a Bug Before It Ships

A regex that misses an edge case or matches too greedily can slip a bug into production. Testing it against real and awkward input first, with exact matches and groups listed, catches the mistake before the code goes out. An online regex tester gives that check in seconds.

A pattern checked before release.

Test on Real Data Privately

A pattern is often tested against a log, a database dump or a sample with real records in it. The test runs in the browser, so that sample stays on the device rather than being pasted into an outside server.

A test without exposing the data.
How it works

Test a Regex Online in Three Steps

1

Enter the Pattern and Text

Type a regular expression in the Regular Expression Pattern field. Paste sample text into the Test Sample Text box, or select Upload to add a .txt, .log, .md, .csv or .json file.

TEXT PATTERN flags
2

Set the Flags

Select the flag buttons the pattern needs, like g for every match, i to ignore case or m for multiline. The Flags field takes typed letters too, and g is on by default.

3 matches
3

Execute and Check the Matches

Select Execute Regex Test in the online regex tester. The Match Results box lists every match with its index and capture groups, up to 50 on screen. Edit the pattern and run again, or select Clear All to start over.

Match results Groups and index
Six flags g i m s u y
One run Up to 50 matches shown
Need it faster?

Desktop Regex Tester for Many Files

The online regex tester checks one pattern against one text per run. A folder or a huge log fits grep or ripgrep better.

Get Desktop Version Free trial · Windows 7 to 11
What the free tool does

What the Online Regex Tester Does

Testing a regex means running a pattern against text and listing what it matches. The online regex tester shows the result as numbered match cards.

Match Results With Index

Select Execute Regex Test and the Match Results box lists every match as its own card, numbered from one, with the index where it starts. A badge shows the count, like 3 matches found.

Six Flag Buttons

The online regex tester has flag buttons that toggle g for global, i for ignore case, m for multiline, s for dotAll, u for unicode and y for sticky. The Flags field takes typed letters too, and g is on by default.

Capture Groups Listed

Every match card lists its capture groups as $1, $2 and so on, in order. The online regex tester shows values only, so a group name is not displayed.

Fifty Matches and Error Messages

The list shows the first 50 matches and says so when more exist. A truncated tag can appear beside the count. A bad pattern returns an error message in the panel.

To test a regex, check a regular expression and debug a pattern all name one job, and a search for online regex tester or test regex online lands on the tool above.

Reference

Online Regex Tester Results, Case by Case

A regex is a pattern run against text. The cases below show what the tool lists, what it leaves out and where results can differ.

The caseResultWhat happens and why
Flagsg i m s u yGlobal, ignore case, multiline, dotAll, unicode and sticky. A d flag for match indices has no button. For how unicode text is stored, see Character encoding explained and why text arrives broken.
Capture groupsnumberedThe online regex tester lists groups by number under every match, as $1, $2 and so on.
Group namesnot shownThe cards list group values by number. A name given in the pattern is not displayed.
Lookaroundcheck itLookahead and lookbehind depend on the engine behind the tester. Run a sample before trusting a pattern that uses them.
Replacenot on this pageThere is no replace mode in the online regex tester. Test the groups here, then run the $1 swap in an editor or in code.
EngineJavaScript flagsFlag names follow JavaScript RegExp. Check a pattern in the target runtime before it ships.
Not PCREdiffersPCRE features like possessive quantifiers or recursion may throw an error or match differently.
ReDoScautionA nested quantifier on untrusted input can backtrack and hang the match.
Runon a clickNothing runs while the pattern is typed. Select Execute Regex Test with a pattern and text or a file in place.
Match limit50 shownThe list stops at 50 matches and says when more exist.
Source file.txt .log .md .csv .jsonSelect Upload to test a pattern against a file instead of pasted text.
Bad patternerror messageAn invalid pattern returns an error message instead of a match list.
Where it runson the deviceThe pattern runs in the browser, so nothing is uploaded.

How a Regex Tester Works

A regular expression is a compact language for describing a search pattern over text, an idea that goes back to Stephen Kleene in 1956 and reached Unix through Ken Thompson and the grep tool. The online regex tester takes a pattern, a set of flags and sample text, then lists every match with its index and capture groups. The flags follow JavaScript, with g for every match, i to ignore case, m for multiline, s for dotAll, u for unicode and y for sticky. Two honest points matter most. The first is flavor. A pattern built for Perl, PHP or Python may lean on a feature like a possessive quantifier or recursion that JavaScript lacks, so test it before trusting it. The second is backtracking. A nested quantifier over hostile input can run away, the pattern behind a class of denial-of-service bug. This page runs one test per click, lists up to 50 matches and has no replace mode or sample library. The references below define the language and its flags, and one of them is a deeper debugger for other flavors.

Honest comparison

Online Regex Tester vs a Full Debugger

Both test a regex. The trade is between a quick focused check and a deeper multi-flavor debugger.

Point of comparison This tool Online regex tester On the device A full debugger A deeper regex debugger
Where the text goes Stays in the browser Often client-side too
Price and caps Free with no file cap Free tier often capped
PCRE, Python or Go JavaScript flavor only Several flavors to select
A token-by-token explainer Matches and groups shown Every token explained
A quick JavaScript test Open and test at once More panels to read

A full debugger like regex101 wins for switching flavors between PCRE, Python and Go, and it can explain a dense pattern token by token. The online regex tester wins for a quick JavaScript check with a plain match list and no clutter. Online file tools and whether yours uploads goes deeper on where a file goes.

Why no upload

Online Regex Tester Privacy and Data Handling

The pattern is run against the text by the browser's own RegExp engine, so the work is client-side and the text stays on the machine that opened it. Nothing is handed to a server to run the match.

The text a pattern is tested against is often a real log, a database dump or a sample with live records in it. A server-side tester would take all of that on upload, needless exposure when the browser can run the match locally.

1. Open the browser tools at the Network tab
2. Clear the log and let it record
3. Test a pattern with the panel above
→ Nothing uploads. The pattern was run on the page itself.
0
Bytes uploaded
0
Files stored
0
Accounts required
0
Watermarks added
Alternatives

Online Regex Tester Alternatives

All of these test a regex. They vary in reach, in flavor and in setup.

regex101

regex101 switches flavors and explains a pattern token by token.
It covers PCRE, Python, Go and JavaScript.
Limit: Defaults to PCRE, so switch to JavaScript flavor.

grep or ripgrep

grep and ripgrep run a pattern over files and folders fast.
They suit a large log or an entire codebase.
Limit: Lives in the terminal with its own regex dialect.

In Code

A RegExp object tests a pattern in a console or a script.
It fits straight into the program that will use it.
Limit: Needs code written first, then run.

An Editor Find

The find box in an editor searches open files by regex.
It works right where the code is written.
Limit: Dialect varies by editor, with few group details.

regex101, grep and a code console all test a regex, yet every one means another flavor, the terminal or a script. The online regex tester above takes a pattern and sample text with nothing to install.

Before converting

Three Things to Know Before Using an Online Regex Tester

Keep these in mind and the results make more sense.

Flags Follow JavaScript

The flag names are JavaScript's: g, i, m, s, u and y. A pattern written for PCRE, Perl or Python may use a feature JavaScript lacks, like a possessive quantifier or recursion. It may throw an error or match differently. Port the pattern to JavaScript syntax first, then run it again.

Keep g On for Every Match

The g flag is on by default in the online regex tester. Without it a pattern finds only the first match, which surprises many. Keep g on to list every match, and add i, m or s when case, line boundaries or a dot across newlines matter.

Watch for Runaway Backtracking

A backtracking engine can hang when a nested quantifier meets hostile input, the pattern behind a denial-of-service bug. Keep a pattern tight on untrusted input, and anchor it rather than leaving it open.

The desktop edition

Desktop Regex Tester for Large Logs

The online regex tester checks one pattern against one sample per run, which suits building and debugging. A multi-gigabyte log, an entire codebase or a pattern inside a build belongs on grep, ripgrep or a script that runs across every file.

In a browser taba page at a time
On the command linean entire tree in one pass
Across Files

Run a pattern over a folder or a codebase in one command, listing every file and line that matches at speed.

Huge Logs

A multi-gigabyte log is streamed from disk and searched, past what a browser tab holds in memory at once.

In a Script

A pattern runs inside a build or a hook, so a check or a bulk replace happens automatically, ready for a repeated workflow.

Common questions

Online Regex Tester Questions

Type your pattern, set the flags and add sample text or a file. Select Execute Regex Test and the Match Results box lists every match with its index and capture groups. Nothing runs while you type, so select the button again after every edit. To compare two result sets, use the online text diff.
Enter your pattern, keep g on for every match, paste your text into the Test Sample Text box and select Execute Regex Test. The button stays off until your pattern and your text or file are in place. To clean a link before you test it, use the online URL encoder decoder.
No. The pattern is run by the browser's own RegExp engine, so the text never leaves the device. This matters, since a regex is often tested against a real log, a database dump or a sample with live records in it.
The online regex tester has six buttons: g for every match, i to ignore case, m for multiline, s for dotAll, u for unicode and y for sticky. The Flags field also takes typed letters, and g is on by default. There is no d flag button, so every match card shows its index instead.
The g flag is off. Without g, a JavaScript regex returns only the first match, and the online regex tester lists just that one. Switch the g button on and run your pattern again to list every match.
Every match gets its own card in the online regex tester, numbered from one, with the index where it starts and the matched text. Capture groups sit under it as $1, $2 and so on. A badge shows the count, like 3 matches found, and a zero count shows No matches found for the provided pattern and text.
No names. A group value appears under the match as $1, $2 in order. If you need the names, check them in your own code with the same pattern.
Not on this page. The online regex tester has no replace mode, so it only lists matches and groups. Test your pattern and groups here, then run the replace in your editor or code, where $1 and $2 drop the groups into your output.
No. The online regex tester has no sample library, only a placeholder that shows the shape of a pattern with two groups. Type your own pattern, or paste one from your code. For filler text to test against, use the online lorem ipsum generator.
Up to 50 in the online regex tester. When there are more, the list says Displaying first 50 matches, and a truncated tag can appear next to your count. Narrow your pattern or your text to see the rest.
Yes. Select Upload in the Test Sample Text box and add a .txt, .log, .md, .csv or .json file. Your pattern is then run against that file in the online regex tester. Paste the text instead if you want to edit it first, and tidy a JSON log with the online JSON formatter.
The flags are JavaScript's, and patterns are written in that style. It is not PCRE, so a pattern built for Perl or PHP may use a possessive quantifier or recursion that fails here. Simple patterns for digits, words and dates carry across languages, but confirm anything advanced in the language you ship. Test your pattern in your own runtime before it ships.
A bad pattern returns an error message in the online regex tester panel, or Failed to evaluate regular expression when no detail comes back. Common causes are an unescaped special character, a group that is not closed or a repeated flag. Fix your pattern and run it again.
It is when a pattern with a nested quantifier meets input that sends the engine down a huge number of paths, so the match hangs. A pattern like (a+)+ on a long run of the letter a is the classic example. It is a real risk on untrusted input and the pattern behind a denial-of-service bug called ReDoS. Keep your pattern tight and anchored before you run it in the online regex tester.
In the online regex tester, without the m flag, ^ and $ match only the start and end of the full text. Switch m on to match at every line break. Mixed line endings can also confuse a pattern, and CRLF vs LF and the two bytes that break things explains the two bytes behind it.
Switch the u flag on in the online regex tester for full unicode handling, so emoji and characters outside the basic range count as one character. Text saved in the wrong encoding can arrive broken before your pattern sees it, and Character encoding explained and why text arrives broken explains why. Decode Base64 text first with the online Base64 encoder.
Yes. It runs in a mobile browser as well as on a desktop, with no app to install. Type your pattern, add your sample text and select Execute Regex Test.
The page is cheap to host, and since the work happens on the device nothing is received or kept here. The wider suite of tools is what supports the site. There is no cap, no watermark and no sign-up.

OnlinePCApps Developer Group

Written and reviewed by Milan Horvat, who has worked on text processing and developer tools here since 2013

Last reviewed October 2026
13
Years on dev tools
0
Patterns uploaded
6
Regex flags
0
Watermarks

The single most useful thing to know about a regex tester is which flags it offers and what it shows. In the online regex tester the flags are JavaScript's, and a run gives a match list with an index and numbered groups for every hit. That matters because a pattern copied from a Perl or Python answer can fail, since PCRE has features like possessive quantifiers and recursion that JavaScript does not. The other point is the g flag. A JavaScript regex without it returns only the first match, which trips up more people than any other detail, so g starts switched on. Two limits are worth stating too. The online regex tester has no replace mode and no sample library, and the list stops at 50 matches. A word of caution belongs with any backtracking engine as well, since a nested quantifier over hostile input can hang, the risk known as ReDoS. Check a finished pattern in the real runtime before it ships.

Standards followed

RegExp · ECMAScript Flags · g i m s u y Groups · Numbered ReDoS · OWASP
Built on the same shared design system as every OnlinePCApps tool. onlinepcapps.com

Test a Regex Online for Free

No sign-up needed. Enter a pattern and sample text in the online regex tester, then select Execute Regex Test.

Test a Regex Free, no account Try Desktop Edition For logs and scripting
Test a Regex