Text & Strings

Regex Tester

Write regular expressions and instantly see all matches highlighted in your test string. Supports flags: global, case-insensitive, multiline.

Open Regex Tester →
Looks like you're using an ad blocker. Devbin is free — ads help keep it running.

What is the Regex Tester?

The Regex Tester is an interactive regular expression testing tool that highlights every match as you type your pattern. It gives you instant visual feedback on what your regex matches, making it easy to iterate and refine patterns without writing any code.

It displays captured groups alongside match highlights and supports all standard JavaScript regex flags: g (global — find all matches), i (case-insensitive), m (multiline — treat ^ and $ as line boundaries), s (dotAll — . matches newlines) and u (Unicode mode).

How to Use It

1

Open Text & Strings

Navigate to the Text & Strings page on Devbin and scroll down to the Regex Tester section.

2

Enter your pattern

Type your regex pattern in the pattern field. Do not include surrounding slashes — just the pattern itself, e.g. \d{3}-\d{4}.

3

Set optional flags

Enable flags as needed: g to find all matches, i for case-insensitive matching, m for multiline mode.

4

Paste your test string

Paste or type your test string in the text area. Matches highlight instantly as you type — no need to click a button.

Common Use Cases

The Regex Tester is invaluable for validating email address patterns, phone number formats, and postal codes before embedding them in application code. It's ideal for extracting structured data patterns from log files, building search patterns for text processing scripts, and learning regex syntax interactively by experimenting with live feedback.

Developers frequently use it to build input validation patterns for forms, test extraction logic for parsing structured text, and refine search-and-replace patterns before using them in an IDE.

Pro Tips

Always use the g flag to find all matches, not just the first. Without it, matching stops after the first occurrence.
Test with i for case-insensitive matching when you want to match "Hello", "hello" and "HELLO" with the same pattern.
Use ^ and $ anchors with the m flag for multiline matching — without m, they only match the very start and end of the entire string.
Wrap sub-patterns in parentheses to create capture groups, e.g. (\d{4})-(\d{2})-(\d{2}) captures year, month, and day from a date string separately.

Frequently Asked Questions

What regex flavour is used?
The tester uses JavaScript (ECMAScript) regular expressions, which are executed natively in your browser. This means patterns behave exactly as they would in JavaScript code with RegExp or the /pattern/flags literal syntax.
How do I escape special characters?
Prefix special regex characters with a backslash. For example: \. for a literal dot, \( for a literal parenthesis, \d to match any digit, \s to match any whitespace character.
Can I test capture groups?
Yes. Matched capture groups are shown alongside the match highlights, so you can see exactly what each group in parentheses captured from the test string.
Why is only the first match highlighted?
Without the g (global) flag, JavaScript regex stops after the first match. Enable the g flag to find and highlight all occurrences in your test string.

Ready to test your regex?

Open the free Regex Tester on Devbin — instant match highlighting, no login required, nothing sent to any server.

Open Regex Tester →