▶ Subscribe on YouTube
Home / Tools / Developer Tools

Regex Tester

Test regular expressions against sample text in real time.

Regular Expression
//
7 matches
Test String
Highlighted Matches
Hello world! This is a regex tester.
Match Details (7)
Match 1 at index 0
Hello
Match 2 at index 6
world
Match 3 at index 13
This
Match 4 at index 18
is
Match 5 at index 21
a
Match 6 at index 23
regex
Match 7 at index 29
tester

What does this tool do?

A regular expression (regex) is a sequence of characters that defines a search pattern. They are used to validate inputs ("is this a valid email address?"), parse text ("find all phone numbers in this log"), and find-and-replace in code editors. Regex syntax is powerful but notoriously difficult to get right without being able to test it. This tester shows you exactly what your pattern matches — highlighted in real time — so you can iterate quickly without writing any code.

How to use it

  1. Enter your regex pattern in the Pattern field (without surrounding slashes).
  2. Add flags below the pattern if needed: g (find all matches), i (case-insensitive), m (multiline).
  3. Paste your test text in the text area.
  4. Matches are highlighted instantly. Adjust your pattern until it captures exactly what you want.

Pro tips

  • Start simple — build your pattern one piece at a time and test each addition before adding the next.
  • Use \b for word boundaries to prevent partial matches — without it, "cat" would also match inside "concatenate".
Example

Pattern: \b[\w.+-]+@[\w-]+\.[\w.]{2,}\b | Flags: g Test text: Contact hello@example.com or support@company.org

Matches highlighted: hello@example.com and support@company.org

Match count: 2

When would you use this?

  • Validating that a form input matches a required format such as an email or phone number
  • Extracting all URLs, email addresses, or dates from a large block of text
  • Finding and replacing patterns in source code using the same pattern you would use in VS Code
  • Parsing log file entries that follow a predictable format