Enter regex pattern and test text
Regex Tester
Test and debug regular expressions with multiple flags and real-time matching results.
Regex Tester - Regex Pattern
Regex Tester Tool Guide
Regex Tester is a free online tool that can quickly test and debug regular expressions. Supports real-time matching, displays matching results immediately after entering regex pattern and test text. Supports multiple regex flags (global match, ignore case, multiline mode, dot matches all, Unicode, sticky match), supports quick selection of common regex patterns (email, phone, URL, IP address, date, number, Chinese, password, credit card, etc.). Provides detailed matching results display, including full match, capture groups, match positions, etc. All processing is done locally in your browser, data is never uploaded to the server, completely protecting your privacy and data security.
Tool Features
Real-time Matching and Detailed Results Display
Supports real-time matching, displays matching results immediately after entering regex pattern and test text, no need to click any button. Provides detailed matching results display, including total matches, full content of each match, capture group information, match positions, etc. Matching results are displayed in colorful cards, clear and intuitive. Supports invalid regex detection, displays error message if regex format is incorrect.
Multiple Regex Flags and Common Patterns
Supports multiple regex flags: global match (g, match all), ignore case (i, case-insensitive), multiline mode (m, ^ and $ match each line), dot matches all (s, . matches newline), Unicode (u, supports Unicode characters), sticky match (y, starts from lastIndex position). Provides quick selection of common regex patterns: email address, phone number, URL, IP address, date format, number format, Chinese characters, strong password, credit card number, etc. Selecting common pattern automatically fills regex pattern, can be used directly or modified based on it.
Convenient Operations and Statistics
Provides detailed statistics including total matches, regex validity, active flags count, test text length, etc. Statistics are displayed in colorful cards, clear and intuitive. Supports one-click copy of matching results, convenient for using results elsewhere. Supports clear function to quickly clear regex pattern, test text, or all content. Both regex pattern input box and test text input box provide independent clear buttons for quick reset. All operations take effect in real-time, results update immediately after modifying input.
How to Use
- 1
Enter Regex Pattern and Test Text
Enter or paste the regex pattern you want to test in the regex pattern input box, or select a predefined pattern from the common patterns dropdown menu (such as email, phone, URL, etc.). Enter or paste the text content you want to test in the test text input box. Matching will be triggered automatically after input, matching results will be displayed immediately in the results area, no need to click any button.
- 2
Configure Regex Flags
Select the regex flags you need in the regex options area: global match (g, match all matching content), ignore case (i, case-insensitive), multiline mode (m, ^ and $ match each line), dot matches all (s, . can match newline), Unicode (u, supports Unicode characters), sticky match (y, starts matching from specified position). Matching results update immediately after selecting flags.
- 3
View Matching Results and Copy
After matching is complete, you can view the matching results list, each match displays full match content, capture groups (if any), match position (start and end positions), etc. Matching results are displayed in green cards, clear and intuitive. You can view the statistics cards to see total matches, regex validity, active flags count, text length, etc. You can click the "Copy Results" button to copy all matching results (including full matches and capture group information), or click the "Clear All" button to clear all content and start over. If the regex pattern is invalid, a red error message will be displayed; if no matches are found, a yellow message will be displayed.
Frequently Asked Questions
What do the regex flags g, i, m, s, u, y mean respectively?
How to test regex patterns with multiline text?
Will my regex test data be uploaded to the server?
Share This Tool
Share this useful tool with your friends and colleagues