Cat Toolbox
Help CatBlog About Partnership 中文
🔍

Regex Tester

Test regular expressions in real-time with group capturing, replacement functionality, and built-in common regex patterns reference

📝 Regular Expression

Pattern
Flags
g (Global) i (Case-insensitive) m (Multiline) s (Dot matches newline) u (Unicode) y (Sticky)

📄 Test Text

🎯 Match Results 🔄 Replace
Waiting for input...
Replace With
Replacement Result
Waiting for input...

📚 Common Regex Reference Click to fill in pattern

Advertisement

FAQ

What is a regular expression?
A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. It's used for string matching, validation, text processing, and data extraction. Common use cases include email validation, phone number verification, log file parsing, and code syntax highlighting.

What do the flags mean?
g (Global): Find all matches instead of stopping at the first match. i (Case-insensitive): Ignore letter case when matching. m (Multiline): Make ^ and $ match the start/end of each line. s (Dotall): Make . match newline characters. u (Unicode): Enable full Unicode matching. y (Sticky): Match only from the lastIndex position.

How do I use backreferences in replacement?
Use $1, $2, etc., to refer to captured groups in the replacement string. For example, if your pattern is (\d{4})-(\d{2})-(\d{2}) and you replace with $2/$3/$1, it will convert "2024-01-15" to "01/15/2024".

Does this tool upload my data?
No. All regex testing and matching happens entirely in your browser. Your input text and patterns are never sent to any server, ensuring complete privacy and security.

Related guide

Comparing Two Versions of a File, and Testing a Regex Before You Ship It
The diff is line-based and has no word-level view — so a Windows-vs-Mac paste marks every line as changed — while the regex tester runs on every keystroke, which is exactly what turns a backtracking pattern into a frozen tab.