logo
DevBox Tools

Check and Test Regular Expressions

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

Quick Reference

Regex Basics

^The start of a string
$The end of a string
.Wildcard which matches any character, except newline (\n)
|Matches a specific character or group of characters on either side
\Used to escape a special character
aThe character "a"
abThe string "ab"

Quantifiers

*Used to match 0 or more of the previous
?Matches 0 or 1 of the previous
+Matches 1 or more of the previous
{5}Matches exactly 5
{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 one digit
\DMatches one non-digit
[\b]A backspace character
\cMatches a control character

Special Characters

\nMatches a newline
\tMatches a tab
\rMatches a carriage return
\ZZZMatches octal character ZZZ (e.g., \040 for space)
\xZZMatches hex character ZZ (e.g., \x20 for space)
\0A null character
\vA vertical tab

Groups

(xyz)Capturing group of characters
(?:xyz)Non-capturing group of characters
[xyz]Matches any one 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 from 'a' through 'q'
[0-7]Matches any digit from '0' through '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 (Lookarounds & Boundaries)

(?=xyz)Positive lookahead (asserts xyz follows)
(?!xyz)Negative lookahead (asserts xyz does not follow)
(?<=xyz)Positive lookbehind (asserts xyz precedes)
(?<!xyz)Negative lookbehind (asserts xyz does not precede)
\bWord Boundary (position between a word char and a non-word char)
\BNon-word Boundary
(?#comment)Comment (ignored by regex engine)

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 finding, validating, and manipulating text. They're 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 postal codes. Learn basic metacharacters like ., *, +, ?, ^, $, and character classes like \d, \w, \s.

Use verbose mode when available, add comments, break complex patterns into smaller parts, and use meaningful variable names. Consider using online regex documentation and testing tools.

Complex patterns with backtracking can be slow on large texts. Optimize by being specific, avoiding nested quantifiers, and using anchors (^ and $) when possible. Test performance with realistic data sizes.

Useful Instruments

o1

Test Regular Expressions

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

o1

Support for Different Flags and Modifiers

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

o1

Generate Templates for Data Parsing

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