ToolsZone
AdvancedNew

Regex Tester

Test and debug regular expressions with real-time matching, capture groups, and replace preview.

//gi
Contact us at support@example.com or sales@company.co.uk Alternative: hello@test.org

Match Details

#MatchIndexGroups
1support@example.com14-
2sales@company.co.uk37-
3hello@test.org70-

Common Patterns

Pattern Explanation

  • . - Any character (except newline)
  • + - One or more occurrences

Quick Reference

. Any char
\d Digit
\w Word
\s Space
* 0+ times
+ 1+ times
? Optional
^$ Start/End

How to use Regex Tester

  1. 1

    Enter Pattern

    Type your regular expression pattern in the pattern field.

  2. 2

    Set Flags

    Toggle flags: g (global), i (ignore case), m (multiline), s (dotall), u (unicode).

  3. 3

    Test String

    Paste or type the text you want to test against the pattern.

  4. 4

    Review Matches

    See highlighted matches, capture groups, and match details in real-time.

Related Tools

Frequently Asked Questions

What are regex flags?

Flags modify regex behavior: g (find all matches), i (ignore case), m (^ and $ match lines), s (dot matches newlines), u (unicode support).

How do capture groups work?

Use parentheses () to create capture groups. Access them in replacements with $1, $2, etc. The full match is $&.

Why is my regex not matching?

Check for proper escaping (use \ for special chars), ensure flags are correct, and verify your pattern syntax.

What is the difference between * and +?

* matches zero or more occurrences, + matches one or more. Use * when something is optional, + when required.

How do I match special characters literally?

Escape them with backslash: \. matches a literal dot, \+ matches a plus sign, etc.