Regex Tester
Tip: Enter only the regex pattern, no need to include slashes /
Match results will appear here...
Common Syntax Reference
Common Metacharacters
.Match any character except newline\wMatch letter, digit or underscore\sMatch any whitespace character\dMatch digit\bMatch word boundary (start or end)^Match start of string$Match end of stringCommon Quantifiers
*Repeat zero or more times+Repeat one or more times?Repeat zero or one time{n}Repeat n times{n,}Repeat n or more times{n,m}Repeat n to m timesCommon Negation
\WMatch any character that is not letter, digit, underscore, or Chinese\SMatch any character that is not whitespace\DMatch any non-digit character\BMatch position that is not word boundary[^x]Match any character except x[^aeiou]Match any character except aeiouRegex Modifiers
iignore - Case insensitivegglobal - Find all matchesmmulti line - ^ and $ match line breakssdotAll - . matches newline \nSimilar Coding Tools
View AllRegex Tester Tool Guide
Tool Introduction
This is a free online regular expression testing tool that supports testing and debugging regular expressions, provides global match and case-insensitive options, displays match results in real-time, helping you quickly verify the correctness of regular expressions.
Usage Steps
- Enter the regular expression to test in the pattern input box
- Enter the text to match in the test text input box
- Select match options: Global Search (-g) and Ignore Case (-i)
- Click the "Test" button or wait for automatic testing
- View match results, including match content, position, and capture groups
Usage Tips
1) Use Global Search (-g) to find all matches, otherwise only the first match is returned; 2) Ignore Case (-i) option makes the regular expression case-insensitive; 3) Supports capture groups, you can view the content of each capture group in the results; 4) All operations are performed locally without uploading any data to the server.
Frequently Asked Questions
Notes
- This tool processes everything locally in the browser and does not upload your text to any server
- If the regular expression syntax is incorrect, an error message will be displayed, please check the syntax
- When using global search, if the regular expression matches empty strings, it may cause infinite loops, the tool will handle this automatically
- Supports copying match results for use elsewhere