Skip to content

Regex tester

Write a regular expression, paste test text, and see matches highlighted instantly. Capture groups, flags, and match details are shown in real time — all in your browser.

/ /gm
Highlighted matches
Match details

What is a regex tester?

A regex tester lets you write a regular expression and immediately test it against sample text. Matches are highlighted in the text, and detailed information about each match — including captured groups — is shown alongside. It's the fastest way to iterate on a regex pattern without running your full application.

When to use a regex tester

  • Writing a validation pattern for emails, phone numbers, URLs, or custom formats
  • Debugging a regex that isn't matching what you expect
  • Learning regex syntax by experimenting with different patterns and flags
  • Extracting data from logs, CSVs, or unstructured text
  • Building search-and-replace patterns for your editor or codebase

Common regex patterns

Some frequently needed patterns: \b\w+@\w+\.\w+\b for basic email matching, ^\d{4}-\d{2}-\d{2}$ for ISO dates, https?://[^\s]+ for URLs, and ^(?=.*[A-Z])(?=.*\d).{8,}$ for password validation with at least one uppercase letter and one digit.

Query your data without writing regex

If you're using regex to search through database records, Basedash offers a faster path. Describe the pattern you're looking for in plain English and Basedash generates the SQL or filter — no regex or manual queries needed. It connects to PostgreSQL, MySQL, MongoDB, and 750+ other data sources.

FAQ

Which regex flavor does this use?

The tool uses JavaScript's built-in RegExp engine, which supports most PCRE-like features including lookahead, lookbehind (in modern browsers), character classes, quantifiers, alternation, and named capture groups.

Is my data sent to a server?

No. The entire matching runs in your browser using JavaScript. Your patterns and test strings are never transmitted, logged, or stored anywhere.

What do the flags mean?

g (global) finds all matches instead of stopping at the first. i (case-insensitive) ignores letter casing. m (multiline) makes ^ and $ match the start and end of each line instead of the whole string. s (dotAll) makes . match newline characters too.

How do capture groups work?

Parentheses in a regex define capture groups. For each match, the tool shows the full match plus every captured group with its index or name. Named groups use the syntax (?<name>...) in JavaScript.

Why does my regex match nothing?

Common causes: forgetting to escape special characters like . or (, having the wrong flags enabled, or using syntax not supported by JavaScript's regex engine. Check the error message below the pattern field for syntax issues.

Can I use this for regex in other languages?

JavaScript's regex is very close to PCRE, so patterns for Python, Ruby, Java, and most other languages will work here for basic testing. Some advanced features like atomic groups or possessive quantifiers aren't supported.

Skip the regex — describe what you need

Connect your data and tell Basedash what to find. It writes the query and filter for you — no regex needed.