#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚡ FREE · RUNS IN YOUR BROWSER

Regex Tester: Try Patterns and See Every Match

Test a regular expression and see its matches and groups.

  • 🖍️ Highlighted matches
  • 🧩 Capture groups listed
  • 🛡️ Stops runaway patterns

How to use the Regex Tester

  1. 1. Enter your patternType the regex without slashes and tick the flags you need.
  2. 2. Add test textPaste the text you want to search.
  3. 3. See the matchesGet highlights, positions and every capture group.

A quick regex example

Say you want to pull email addresses out of some text. Use the pattern (\w+)@(\w+\.\w+) with the g flag on this text:

Write to asha@example.com or ravi@test.org

You get two matches. For the first one, group 1 is asha and group 2 is example.com. Brackets create groups, and that is how you pull out only the part you need. This is a learning pattern, not a full email validator.

  • \d matches a digit and \w a letter, digit or underscore.
  • + means one or more, and * means zero or more.
  • ^ and $ mark the start and end.
  • (?<year>\d{4}) makes a named group.

Why slow patterns are stopped

Some patterns can take almost forever on certain text. Nested repeats like (a+)+$ make the regex engine try a huge number of combinations, which is called catastrophic backtracking. On a normal page, that would freeze your tab.

This tester runs your pattern in a separate background worker. If it takes more than 2 seconds, the worker is stopped and you get a clear message, so the page keeps working. It is also useful for spotting these patterns before they reach your server.

This tool uses the JavaScript flavour, so it matches what your browser and Node.js do. Python, PHP and Java differ in some details. Your text stays in your browser. Testing a data file? Clean it first with the JSON formatter, or encode a pattern for a link with the URL encoder.

Frequently asked questions

Which regex flavour is this?

JavaScript. Results match browsers and Node.js. Other languages support similar syntax but differ in some features.

What do the flags do?

g finds all matches, i ignores case, m lets ^ and $ work on each line, s lets the dot match line breaks, and u turns on full Unicode.

Why was my pattern stopped?

It took more than 2 seconds, which usually means nested repeats are backtracking. Try making the repeated part more specific.

Is this tool free?

Yes, it is free. We ask for your name and WhatsApp number once when you see your result, and other Uncodemy tools then open without the form.

More free tools

See all free tools