Test String

Matches

What is a Regex Tester?

A regex tester lets you write a regular expression pattern and instantly test it against a string to see all matches. It shows you the matched text, its position in the string, and how many total matches were found.

Regular expressions are powerful patterns used in almost every programming language for searching, validating, and transforming text. A live tester makes it much easier to build and debug complex patterns.

How to Use the Regex Tester

1

Enter a Pattern

Type your regular expression into the Pattern field. You do not need to include surrounding slashes.

2

Set Flags

Enter flags in the Flags field (e.g. gi for global, case-insensitive). Common flags: g global, i case-insensitive, m multiline, s dot-all.

3

Type Your Test String

Type or paste the text you want to test in the Test String editor. Matches appear instantly in the output panel.

Example

Here is a classic example matching email addresses:

Matching email addresses

Pattern: [a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}   Flags: gi

Test String

Output:

Output

Frequently Asked Questions

What regex flavour does this tool use?

This tool uses the JavaScript RegExp engine, which is compatible with ECMAScript regular expressions. It supports most common features including lookaheads, lookbehinds, named groups, and Unicode.

What does the "g" flag do?

The g (global) flag makes the engine find all matches in the string instead of stopping after the first one. Without it, only the first match is returned.

Is my data sent to a server?

No. All matching runs entirely in your browser using the built-in JavaScript regex engine. Nothing is transmitted.

Related Tools

See also: JSON Validator, JSON Formatter.