Check and Test Regular Expressions
Test regular expressions online. Analyze matches, correct errors, and create effective patterns for data search.
RegEx testing
Regular expression result
Matches
No matches found
Remainder
No non-matching content
Test regular expressions online. Analyze matches, correct errors, and create effective patterns for data search.
No matches found
No non-matching content
Allows you to check RegExp patterns in real-time, which simplifies the development and debugging of complex search patterns.
Allows you to consider case sensitivity, global search, multiline mode, and other settings used in programming languages.
Allows you to quickly create expressions for automatic processing of large text arrays, logs, and HTML code.
Regular expressions (Regex) are a pattern-matching language used for searching, validating, and processing text.
With regex, you can:
find specific text fragments (e.g., email, URLs, numbers)
validate data formats (form validation)
replace and clean text
extract structured data from strings
Regex is widely used in development, data analytics, SEO, and automation.
This tool allows you to test regular expressions in real time and instantly see the results.
With it, you can:
check if a string matches a pattern
view all matches within a text
debug complex expressions
test different regex variations without writing code
Regular expressions are not fully universal. Syntax support depends on the programming language and engine.
Engine | Use | Features |
|---|---|---|
JavaScript (ECMAScript) | Browsers, Node.js | Limited lookbehind (depends on version) |
PCRE | PHP, many tools | One of the most powerful engines |
Python (re) | Python | Missing some PCRE features |
Java (Pattern) | Java | Strict syntax |
.NET | C# | Extended capabilities |
Always test your regex in the target environment. Pay attention to differences in lookbehind and Unicode support. For cross-platform compatibility, prefer simpler patterns.
Flags are modifiers that change how the pattern is processed. They allow you to control the case, the search scope (the entire line or several lines), and the interpretation of characters.
Flag | Meaning |
|---|---|
i | Case-insensitive |
g | Global search |
m | Multiline mode |
s | Dotall (includes \n in .) |
u | Unicode |
Type | Symbol | Description |
|---|---|---|
Anchors (positions) | ^ | Start of string |
Anchors (positions) | $ | End of string |
Anchors (positions) | \b | Word boundary |
Anchors (positions) | \B | Not a word boundary |
Metacharacters | . | Matches any character except newline (\n) |
Metacharacters | | | OR operator |
Metacharacters | \ | Escape character |
Literals | a | Character “a” |
Literals | ab | String “ab” |
Quantifiers | * | 0 or more repetitions |
Quantifiers | ? | 0 or 1 repetition |
Quantifiers | + | 1 or more repetitions |
Quantifiers | {5} | Exactly 5 repetitions |
Quantifiers | {5,} | 5 or more repetitions |
Quantifiers | {5,10} | Between 5 and 10 repetitions |
Character Classes | \s | Whitespace |
Character Classes | \S | Non-whitespace |
Character Classes | \w | Word character (alphanumeric + underscore) |
Character Classes | \W | Non-word character |
Character Classes | \d | Digit |
Character Classes | \D | Non-digit |
Escape Sequences | [\b] | Backspace |
Escape Sequences | \c | Control character |
Escape Sequences | \n | Newline |
Escape Sequences | \t | Tab |
Escape Sequences | \r | Carriage return |
Escape Sequences | \ZZZ | Octal character |
Escape Sequences | \xZZ | Hex character |
Escape Sequences | \0 | Null character |
Escape Sequences | \v | Vertical tab |
Groups | (xyz) | Capturing group |
Groups | (?:xyz) | Non-capturing group |
Sets and Ranges | [xyz] | Any of x, y, z |
Sets and Ranges | [^xyz] | Not x, y, z |
Sets and Ranges | [a-q] | Range from a to q |
Sets and Ranges | [0-7] | Range from 0 to 7 |
Replacement Patterns | $` | Text before match |
Replacement Patterns | $' | Text after match |
Replacement Patterns | $+ | Last captured group |
Replacement Patterns | $& | Entire match |
Replacement Patterns | $n | Captured group (e.g., $1, $2) |
Lookarounds | (?=xyz) | Positive lookahead |
Lookarounds | (?!xyz) | Negative lookahead |
Lookarounds | (?<=xyz) | Positive lookbehind |
Lookarounds | (?<!xyz) | Negative lookbehind |
Comments | (?#comment) | Comment (ignored by engine) |
Task | Regex |
|---|---|
Digits only | ^\d+$ |
Latin letters only | ^[A-Za-z]+$ |
Date (DD.MM.YYYY) | \d{2}\.\d{2}\.\d{4} |
Domain | ^[a-z0-9.-]+\.[a-z]{2,}$ |
URL | https?:\/\/[^\s]+ |
Slug | ^[a-z0-9-]+$ |
Email (basic) | ^[^\s@]+@[^\s@]+\.[^\s@]+$ |
Email (strict) | ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$ |
Phone (generic) | ^\+?\d{7,15}$ |
HTML tags | <[^>]+> |
Strong password | ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_]).{12,}$ |
UUID | ^[0-9a-fA-F-]{36}$ |
HEX color | ^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$ |
IP (IPv4) | ^(\d{1,3}\.){3}\d{1,3}$ |
MAC address | ^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$ |
Regular expressions often appear simple, but they contain many hidden nuances. Below are common errors that lead to incorrect results.
Missing escaping: . matches any character, not a literal dot → use \.
Incorrect quantifier usage: *, +, {} apply to the previous token, not the whole string
Greedy vs lazy confusion: .* is greedy → use .*? for minimal matching
Missing anchors ^ and $: without them, matches may occur anywhere in the string
Case sensitivity: "Test" ≠ "test" → use i flag if needed
Whitespace confusion: \s includes tabs, newlines, etc., not just spaces
Using \w for Unicode: in most engines \w = [A-Za-z0-9_] (no Cyrillic, etc.)
Parsing complex formats (HTML, JSON) with regex: unreliable → use parsers
Overly complex patterns: hard to maintain and debug
Nested quantifiers: e.g., (.*)+ may cause catastrophic backtracking
Unbounded patterns: .* without limits can slow down processing on large inputs
Please note that regular expressions in this tool are processed according to the ECMAScript standard (JavaScript RegExp). This means that the behavior of patterns corresponds to how they work in a browser or in JavaScript code. Some constructs, such as character escaping (/ and /), may behave the same way, even if they look different. If you are used to regular expressions in other languages (for example, Python, PHP, .NET or POSIX), note that they may have differences in syntax and matching logic.
This tool allows you to test regular expressions (RegEx) and check their operability. RegEx is widely used in programming, data processing, and SEO analytics.
With it, you can search, replace, and analyze text patterns, simplifying work with large amounts of data.
Regular expressions (regex) are powerful pattern-matching tools for searching, validating, and manipulating text. They are essential for data validation, search operations, and text processing tasks.
Our regex tester allows you to input patterns and test strings to see matches in real-time. You can experiment with different patterns and see which parts of your text match the expression.
Common patterns include email validation, phone numbers, dates, URLs, and zip codes. Learn basic metacharacters like ., *, +, ?, ^, $ and character classes like \d, \w, \s.
Commonly used flags include i (case-insensitive), g (global search), m (multiline mode), and u (Unicode support). They help control searching and matching more precisely.
Complex patterns with backtracking can be slow on large texts. Optimize by being specific, avoiding nested quantifiers, and using anchors (^ and $) where possible. Test performance with realistic data sizes.
Capturing groups are parts of a regular expression (defined by parentheses) that allow you to extract specific subsections of the text that match the pattern. This is useful for reformatting or extracting specific data.
'Greedy' quantifiers (e.g., `.*`) will try to match as many characters as possible. 'Lazy' quantifiers (e.g., `.*?`) will try to match as few characters as possible. The choice depends on the desired matching behavior.
Most modern regular expression implementations support Unicode, allowing for matching characters across different languages and alphabets. However, exact support can vary between programming languages and tools.