🐒monkey type
home/developer tools

Regex Tester

Free online regex tester. Test and debug regular expressions instantly. Supports JavaScript, Python and PCRE. Highlights matches in real time. No login needed.

developer tools

useful utility helpers and calculators for day-to-day developer workflows.

Regex Tester — Test Regular Expressions Online Instantly

Check performance hardware specs, optimize key inputs, and verify your configurations in real-time with our free tools.

How to Use the Regex Tester

Enter your regular expression pattern in the input field, add your regex flags (e.g., gi for global and case-insensitive), and type or paste your test text. The matches will highlight in real-time.

Supported Regex Flavors

Different languages use different syntax patterns. Our engine supports the main ones:

JavaScript Regex

Uses the native V8 JavaScript regex engine, conforming to ECMAScript standards.

Python Regex

Supports standard python re module syntax specifications.

PCRE (PHP, Perl)

Perl Compatible Regular Expressions, providing advanced lookbehinds and conditional matches.

Regex Syntax Quick Reference

A fast reference for writing common regex patterns.

Character Classes

\d matches digits, \w matches word characters, [a-z] matches any character in the range.

Quantifiers

* (0 or more matches), + (1 or more matches), ? (0 or 1 matches), {n,m} (between n and m matches).

Anchors and Boundaries

^ marks start of string, $ marks end of string, \b marks word boundaries.

Groups and Capturing

(...) captures matching substrings into groups, (?:...) defines non-capturing groups.

Lookahead and Lookbehind

(?=...) matches if followed by pattern, (?<=...) matches if preceded by pattern.

Common Regex Patterns and Use Cases

Ready-to-use patterns for validation filters:

Email Validation Regex

^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$

URL Matching Regex

https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)

Phone Number Regex

^\+?\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}$

Password Strength Regex

^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$

How to Debug a Failing Regex Pattern

Break down your pattern into smaller matching steps, check boundary anchors, and ensure special character escapes are correct.

Regex Tester for JavaScript vs Python — Key Differences

Python supports named capture groups and specific lookbehinds differently than JavaScript's V8 implementation.

Frequently Asked Questions

How do I test a regular expression online?

Input your pattern, select your flags, and write test content to see match lists instantly.

What is the difference between PCRE and JavaScript regex?

PCRE supports advanced matching features like recursion and conditional matching, while JS regex is optimized for browser execution.

How do I write a regex to validate an email address?

A basic standard pattern is: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$.

What does the g flag do in regex?

The global flag (g) ensures the engine finds all matches in the text rather than stopping after the first match.

How do I match a group in regex?

Wrap the desired sub-pattern in parentheses (...) to capture it as a match group.