100% client-side · nothing leaves your browser

Regex Builder & Tester Build Regular Expressions Online

Build Regex is a free online regex builder,regex tester, and complete regular expression reference — build a pattern visually, test it live, and copy it out. 100+ documented patterns, a 28-chapter course, and graded challenges. No account, no upload, nothing sent to a server.

New to this? Start withwhat a regular expression isor grab theregex cheat sheet.

100+Regex Patterns
220+Topics & Tags
LiveInteractive Playground
12+Programming Languages

Everything you need for regular expressions

One site for writing a pattern, checking it, understanding it, and shipping it.

An advanced regex tester

Paste a pattern and your own sample text, then watch every match highlight in place. Capture groups — numbered and named — are broken out per match, replacements are previewed before you run them, and compile errors come straight from the engine.

Open the regex tester →

A visual regex generator

Do not know the syntax yet? Describe the shape of your text and click blocks for each piece. The generator compiles them into a valid regular expression with the escaping, quantifier scope, and grouping handled for you.

Generate a pattern →

A regular expression builder

Nest groups, add lookaheads, and set repetition on any block. Complex expressions stay balanced and readable while you assemble them, then export straight to the tester in one click.

Open the builder →

A regex learning platform

A 28-chapter course from literals to negative lookbehind, each with a runnable demo and exercises, plus graded challenges that check your pattern against hidden test cases and a scored quiz.

Start the course →

A complete regex reference

Every anchor, character class, quantifier, group, assertion, escape, and flag on one printable page — plus a library of 100+ documented patterns with token-by-token breakdowns and test cases.

View the cheat sheet →

A Python & JavaScript regex helper

Language guides covering the Python re module and the JavaScript RegExp object end to end, and a ready-to-paste snippet in twelve languages on every pattern page.

Read the Python guide →

Most used

Popular Regex Patterns

The patterns developers reach for most — email, URLs, UUIDs, and more.

View all →
MediumValidation

Email Regex

Validates common email address formats by requiring a local part, an @ symbol, a domain, and a top-level domain of at least two letters.

^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$
MediumWeb

URL Regex

Validates HTTP and HTTPS URLs with a required host containing at least one dot, an optional port, and an optional path, query, or fragment.

^https?:\/\/[\w-]+(\.[\w-]+)+(:\d+)?([\/?#][^\s]*)?$
EasyNumbers

Integer Regex

Validates a whole number with an optional leading minus sign, disallowing decimal points and unnecessary leading zeros.

^-?(0|[1-9]\d*)$
EasyWeb

Hex Color Code Regex

Validates a CSS hex color code in either the six-digit (#RRGGBB) or shorthand three-digit (#RGB) form.

^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
EasyProgramming

UUID Regex

Validates a standard 8-4-4-4-12 hyphenated UUID string, including the version nibble and RFC 4122 variant bits.

^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
MediumSecurity

JWT (JSON Web Token) Regex

Checks that a string has the three-part, dot-separated base64url shape of a JSON Web Token (header.payload.signature) without decoding or verifying the signature.

^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$
EasyNumbers

Percentage Regex

Validates a percentage value: a signed integer or decimal number immediately followed by a trailing percent sign.

^-?\d+(\.\d+)?%$
EasyDates

ISO 8601 Date Regex

Validates a calendar date in ISO 8601 YYYY-MM-DD format, checking that the month is 01-12 and the day is 01-31.

^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

Browse by topic

Featured Categories

Every pattern is organized into a category so you can find what you need fast.

Start where you are

Regular expressions look cryptic until the pieces click into place, and then they become one of the most portable skills in software — the same pattern works in JavaScript, Python, Java, Go, your editor's find-and-replace, and a grep command in the terminal. Wherever you are on that curve, there is a starting point here.

Frequently Asked Questions

Common questions about regular expressions and about Build Regex.

What is a regular expression (regex)?

A regular expression, usually shortened to regex, is a compact way of describing a pattern in text. Instead of searching for one fixed word, you describe the shape of what you want — "three digits, a hyphen, then four digits" — and the regex engine finds every piece of text with that shape. Regular expressions are built into almost every programming language and are used for validation, search-and-replace, parsing, and data extraction.

Is Build Regex free to use?

Yes, entirely. There is no account, no sign-up, no rate limit, and no paid tier. The regex tester, the visual generator, the library of 100+ patterns, the 28-chapter course, the challenges, and the quiz are all free.

Does Build Regex store my patterns or test data?

No. Build Regex is a client-side, offline-first application. Pattern compilation, matching, quiz scoring, and lesson progress all run locally in your browser using the native JavaScript RegExp engine. No pattern and no test text is ever sent to a server, so you can safely paste production logs or internal data.

How do I test a regular expression here?

Open the regex tester, type your pattern into the expression field, set the flags you need, and paste your sample text underneath. Matches highlight in place as you type, and the results panel lists each match with its position and every capture group. You can also preview a replacement before running it.

How do I build a regex without knowing the syntax?

Use the visual regex generator. You add blocks for the pieces you need — a digit repeated three times, an optional hyphen, a group, a lookahead — and the tool compiles them into a valid expression, handling escaping and quantifier placement for you. The compiled pattern updates live, so it also teaches the syntax as you go.

Can I practise writing regular expressions?

Yes. The challenges workspace has graded exercises from Easy to Expert; you write a pattern and it is checked against hidden test cases, including inputs that should be rejected. The quiz covers the concepts — anchors, character classes, quantifiers, groups, lookaround, flags, and performance — with an explanation for every answer.

Which programming languages do the patterns work with?

Every pattern in the library ships with a ready-to-paste snippet for JavaScript, TypeScript, Node.js, Python, Java, C#, PHP, Go, Rust, Ruby, Kotlin, and Swift. The core syntax is shared across all of them; where a language differs — Go's RE2 has no lookbehind, for example — the pattern page says so.

Is Build Regex a good alternative to Regex101?

For most jobs, yes: it runs entirely client-side, adds a visual builder and a documented pattern library, and includes a full learning path. Regex101 is still the better choice when you need to test PCRE, Python, Java, Go, or .NET flavours specifically, or when you want its step-by-step match debugger. A detailed side-by-side comparison is on the Regex101 alternative page.