Developer

Regex Tester

Write a regular expression and see every match highlighted as you type β€” with capture groups, named groups and a live find-and-replace preview.

Flags

Highlighted matches

2 matches

Contact Ayesha at ayesha.khan@example.com or bilal+jobs@example.org. Course page: https://example.com/courses/regex?ref=class Call 0300-1234567 or +92 321 7654321 (US office: (555) 123-4567). Server 192.168.1.10 went down on 2026-03-14. Brand colours: #4f46e5 and #10b981. Test card: 4242 4242 4242 4242 <strong>Hello</strong> <em>Lahore</em> ayesha_k

Matches & capture groups

Position and groups for each match.

  1. Match 1index 18–41
    Match
    ayesha.khan@example.com
    $1
    ayesha.khan
    $2
    example.com
    <user>
    ayesha.khan
    <domain>
    example.com
  2. Match 2index 45–67
    Match
    bilal+jobs@example.org
    $1
    bilal+jobs
    $2
    example.org
    <user>
    bilal+jobs
    <domain>
    example.org

Replace

Use $1, $2 for numbered groups, $<name> for named groups and $& for the whole match. Leave it empty to delete matches.

Result

Contact Ayesha at ayesha.khan [at] example.com or bilal+jobs [at] example.org.
Course page: https://example.com/courses/regex?ref=class
Call 0300-1234567 or +92 321 7654321 (US office: (555) 123-4567).
Server 192.168.1.10 went down on 2026-03-14.
Brand colours: #4f46e5 and #10b981.
Test card: 4242 4242 4242 4242
<strong>Hello</strong> <em>Lahore</em>
ayesha_k

Common patterns

Tap one to load it into the tester.

  • Live highlighting

    Matches light up in your text as you type, including zero-length matches like ^ and \b.

  • Capture groups

    See the index, full match, numbered groups and named groups for every match.

  • Pattern library

    Start from tested patterns for emails, URLs, Pakistani and US phone numbers, dates and more.

Free online regex tester

Regular expressions (regex) are patterns for finding and changing text. They are used for form validation, log parsing, data cleaning and search-and-replace in code editors. This tester runs the pattern with your browser's JavaScript regex engine, so what you see here is exactly what String.match, RegExp.exec and String.replace will do in your code.

Flags explained

  • g (global): find every match instead of stopping at the first one.
  • i (ignore case): treat uppercase and lowercase letters as the same.
  • m (multiline): ^ and $ match at the start and end of every line, not just the whole text.
  • s (dot all): . also matches line breaks.
  • u (unicode): treat emoji and other characters outside the basic range as a single character, and enable \p{…} property escapes.

How to use it

  1. Type a pattern without the surrounding slashes, then switch on the flags you need.
  2. Paste the text you want to test. Matches are highlighted and listed with their groups.
  3. Add a replacement such as $2-$1 or $<name> to preview a find-and-replace, then copy the result.

Good to know

  • Regex syntax is mostly shared between JavaScript, Python, PHP and Java, but details differ β€” for example Python writes named groups as (?P<name>…).
  • Patterns with nested repetition such as (a+)+ can take a very long time on text that almost matches (catastrophic backtracking). If the page stops responding, simplify the pattern.
  • The highlighter shows up to 1,000 matches so very broad patterns stay fast on phones.

Private by design. Everything runs in your browser β€” nothing you enter is uploaded or stored by AISeekho.