Regex Tester

/ /
Quick Reference
.Any character except newline
\dDigit (0-9)
\wWord character (a-z, A-Z, 0-9, _)
\sWhitespace
\bWord boundary
[abc]Character class: a, b, or c
[^abc]Not a, b, or c
a|ba or b
(...)Capture group
(?:...)Non-capture group
a*0 or more
a+1 or more
a?0 or 1
a{3}Exactly 3
a{3,}3 or more
a{3,6}Between 3 and 6
^Start of string/line
$End of string/line
(?=...)Positive lookahead
(?!...)Negative lookahead

How to Use

1

Enter your regex pattern and set flags

2

Type or paste your test string

3

See matches highlighted in real-time

𝕏 Share Facebook LinkedIn Reddit
Used 0 times on this device

How to Use Regex Tester

  1. 1
    Enter your regular expression
    Type your regex pattern in the Pattern field. Include flags like g (global), i (case-insensitive), m (multiline) as needed.
  2. 2
    Paste test text
    Enter the text you want to test against your regex in the Test String area.
  3. 3
    See matches highlighted
    All regex matches are highlighted in real time in the test string as you type.
  4. 4
    View match details
    Scroll down to see a list of all matches, including capture group values.

Features

Use Cases

Validate email addresses

Build and test a regex pattern to validate email format before using it in form validation code.

Extract data from text

Use capture groups to extract specific fields like dates, prices, or codes from unstructured text.

Search and replace patterns

Test a find-and-replace regex before running it in a text editor or code to avoid unintended changes.

Log file parsing

Write and test regex patterns for parsing server log entries, error messages, or structured log data.

Form input validation

Develop and test regex rules for validating phone numbers, postal codes, or custom input formats in web forms.

Frequently Asked Questions

Q: What regex syntax does the tool use?

The tool uses JavaScript's native RegExp engine, which follows ECMAScript regex syntax.

Q: What flags are supported?

g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode), and y (sticky).

Q: Is my text uploaded anywhere?

No. All regex processing happens in your browser using JavaScript.

Q: Why doesn't my regex work?

Common issues include missing escape characters (use \. for a literal dot), wrong flags, or unbalanced parentheses. Check the error message displayed.

Q: Can I use lookahead and lookbehind?

Lookahead ((?=...) and (?!...)) is supported. Lookbehind ((?<=...) and (?

More Free Tools

Sister site: GenFactories – Fun Generators