BrightLichi
// online regex tester & debugger

Write, test & debug regular expressions

A full regex workbench in your browser — live highlighting, token explanation, substitution, extraction, unit tests and code generation. Nothing uploaded, nothing to install.

g i m s u y flags6 sample patternsJS · Python · PHP · Java · Go$0 · client-side
regex — bash
$ regex --pattern '\d{10}' --flags g
/\d{10}/g
Call 9876543210 or 8123456789, not 12345 or 42.
✓ 2 matches · 0.2ms · client-side
$ regex --interactive

The workbench

Regular Expression
//gm
match3 matches

Explanation

(Start of a capture group
[a-zA-Z0-9._%+-]Any single character in this set
+One or more of the previous token
)End of the group
@The literal character "@"
(Start of a capture group
[a-zA-Z0-9.-]Any single character in this set
+One or more of the previous token
)End of the group

Match Information

Match 1[12–33]
hello@brightlichi.com
$1hello
$2brightlichi.com
Match 2[37–57]
support@example.org.
$1support
$2example.org.
Match 3[65–86]
sales@brightlichi.com
$1sales
$2brightlichi.com

Quick Reference

25 tokens
// why developers keep this tab open
$ match --live

Live match highlighting

Every match lights up inside your text the instant you edit the pattern or string. No run button, no waiting — just type and watch.

$ explain --tokens

Token-by-token explanation

See your pattern broken down piece by piece in plain English — every class, quantifier, group and anchor, as you build it.

$ groups --capture

Capture group inspection

Each match lists its full value, position range and every capture group — numbered and named — ready to reuse in substitutions.

$ substitute --preview

Substitution & extraction

Preview find-and-replace with $1, $2 backreferences, or pull matches out through your own output template, live.

$ test --unit

Unit tests that stick

Lock down a pattern with should-match / should-not-match cases. They save in your browser and re-run on every edit.

$ export --code

Code generation

Turn your pattern into ready-to-paste code for JavaScript, Python, PHP, Java or Go — copy and drop it straight into your project.

// how it works

Three steps

step-01.sh
$ ./write

Write the pattern

Type a regular expression, or load a tested one from the samples menu.

step-02.sh
$ ./paste

Paste your text

Drop in a log line, a CSV row, an API response — whatever you need to search.

step-03.sh
$ ./read

Read the output

Matches highlight live; the side panels explain the pattern and list every capture.

// the basics

What is a regular expression?

A regular expression — regex for short — is a compact way to describe a search pattern. Instead of looking for one exact word, you describe the shape of what you want: “ten digits in a row”, “something that looks like an email”, or “every word starting with a hash”. Developers reach for regex to validate inputs, search logs, find-and-replace in an editor, clean messy data, and pull pieces out of text. The catch is that one small slip breaks the whole pattern — which is exactly why testing it here first saves time.

// example
extract-phones.log
# pull every 10-digit number out of an export
pattern = /\b\d{10}\b/g
add the g flag → every match highlights at once, with a live count
✓ done in under a second — no scrolling line by line
// faq

Frequently asked questions

$ ./get-it-right --first-try

Stop guessing at your patterns

Free, private and instant. Scroll up, paste your text, and watch it match.

Related tools

Was this tool useful?