Check and Test Regular Expressions

Test regular expressions online. Analyze matches, correct errors, and create effective patterns for data search.

Matches

No matches found

Remainder

No non-matching content

Quick Reference

Regular Expression Basics

^Start of string
$End of string
.Metacharacter that matches any character except a newline (\n)
|Matches the specified character or group of characters on either side (OR)
\Used to escape a special character
aThe character 'a'
abThe string 'ab'

Quantifiers

*Matches 0 or more occurrences of the preceding element
?Matches 0 or 1 occurrence of the preceding element
+Matches 1 or more occurrences of the preceding element
{5}Matches exactly 5 occurrences
{5,}Matches 5 or more occurrences of the preceding character or group
{5,10}Matches between 5 and 10 occurrences

Character Classes

\sMatches a whitespace character
\SMatches a non-whitespace character
\wMatches a 'word' character (alphanumeric + underscore)
\WMatches a non-'word' character
\dMatches a single digit
\DMatches a single non-digit character
[\b]Backspace character (backspace)
\cMatches a control character

Special Characters

\nMatches a newline character
\tMatches a tab character
\rMatches a carriage return character
\ZZZMatches the octal character ZZZ (e.g., \040 for a space)
\xZZMatches the hexadecimal character ZZ (e.g., \x20 for a space)
\0Null character (Null)
\vVertical tab

Groups

(xyz)Capturing group of characters
(?:xyz)Non-capturing group of characters
[xyz]Matches any single character from the set x, y, or z
[^xyz]Matches any character *not* in the set x, y, or z
[a-q]Matches any character in the range from 'a' to 'q'
[0-7]Matches any digit in the range from '0' to '7'

String Replacements

$`Inserts the portion of the string that precedes the match
$'Inserts the portion of the string that follows the match
$+Inserts the last matched capturing group
$&Inserts the entire matched string
$nInserts the nth captured group (e.g., $1, $2)

Assertions (Lookaheads/Lookbehinds & Boundaries)

(?=xyz)Positive lookahead (asserts that xyz follows)
(?!xyz)Negative lookahead (asserts that xyz does *not* follow)
(?<=xyz)Positive lookbehind (asserts that xyz precedes)
(?<!xyz)Negative lookbehind (asserts that xyz does *not* precede)
\bWord boundary (position between a 'word' and a non-'word' character)
\BNot a word boundary
(?#comment)Comment (is ignored by the regex engine)

Features of the "Regex Tester"

Test Regular Expressions

Allows you to check RegExp patterns in real-time, which simplifies the development and debugging of complex search patterns.

Support for Different Flags and Modifiers

Allows you to consider case sensitivity, global search, multiline mode, and other settings used in programming languages.

Generate Templates for Data Parsing

Allows you to quickly create expressions for automatic processing of large text arrays, logs, and HTML code.

Check and Test Regular Expressions

alien

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.

Frequently Asked Questions (FAQ)

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.

Rate this tool

4.5(24 users rated)