# Regex tester

Test regular expressions with live highlights

Use it at https://www.quicktoolz.com/tools/regex-tester. From QuickToolz.

A regular expression is a short pattern that finds text. Enter a pattern and some test text to see every match highlighted, with its position and groups in a table. Patterns run in the background with a one-second limit, so one that would run for ever can’t freeze your browser. Nothing is uploaded.

## How it works

Your pattern runs against your text, and every match is highlighted.

This uses the JavaScript regex engine, the same one your browser runs. Flags change how a pattern behaves, such as ignoring case.

Some patterns get exponentially slower on certain text. We stop those after a second, and tell you why.

Worked example: The pattern \d+ means “one or more digits”, so in “a1 b22” it finds 1 and 22.

## Examples

| Pattern | Finds |
| --- | --- |
| \d+ | Numbers |
| ^\w+ | The first word |
| \s+ | Spaces |
| [aeiou] | Vowels |

## What this tool doesn't cover

- Other languages have slightly different regex rules.
- We show up to 1,000 matches.

## Questions

### Why did my pattern time out?

It may backtrack too much, often from nested repeats such as (a+)+. Try a simpler pattern.

### Which regex flavour is this?

JavaScript, as used in browsers and Node.js.

### Is my text uploaded?

No. Everything runs in your browser.

### How do I test a regular expression?

Enter a pattern and some sample text. Matches are marked as you type, so you can adjust it until it’s right.

### What do the g and i flags do?

The g flag finds every match, not just the first. The i flag ignores upper and lower case.

## Sources

- [MDN: Regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions)