Regex Tester
Regex tester. Enter a regular expression pattern and test string, select a flavor (PHP, JavaScript, Python, Java, .NET, Ruby, etc.), and check match results in real time. Match results include detailed information such as matched parts, capture groups, and match positions. All processing is performed locally in the browser, with no dependency on external APIs.
Flags
How to use
About this tool
Input a regular expression pattern and test string, select a flavor (PHP, JavaScript, Python, Java, .NET, Ruby, etc.), and check match results in real time. Match results include detailed information such as matched parts, capture groups, and match positions. All processing is performed locally in the browser, with no dependency on external APIs.
How to use
Enter a regular expression pattern and test string; match results are displayed in real time. Select a flavor to compute match results based on that flavor's regex syntax. Set flags (global, case insensitive, multiline, dot all) to control match behavior.
Use cases
• Verify and debug regular expression patterns • Check regex syntax differences across flavors • Verify capture group behavior • Learn and understand regular expressions • Validate regex patterns during code review
How it works
Uses JavaScript's RegExp API to compute match results. Differences between flavors (PHP, JavaScript, Python, Java, .NET, Ruby) are handled through flag mapping and error handling. Match results include detailed information such as matched parts, capture groups, and match positions. All processing is done in the browser; no dependency on external APIs.
Privacy and data
All processing is done entirely in the browser; regular expression patterns and test strings are never sent to any server. Input data is handled only in memory and is not saved.
FAQ
- Q: What regex flavors are supported?
- A: PHP (PCRE), JavaScript, Python, Java, .NET, and Ruby. Select the flavor to apply that language's flag mapping and syntax rules. Under the hood, JavaScript's RegExp API handles the matching, with flavor differences managed through flag translation.
- Q: What flags are available?
- A: Global (g) — find all matches; Case insensitive (i) — ignore letter case; Multiline (m) — ^ and $ match line boundaries; Dot all (s) — . matches newline characters too.
- Q: How do I test capture groups?
- A: Use parentheses to define capture groups in your pattern (e.g. (\d+)-(\w+)). The match results show each group's matched value and its position in the string, making it easy to verify group behavior before using it in code.
- Q: Why does my PHP/Python regex not work the same as in the tool?
- A: The tool uses JavaScript's RegExp for matching, so PCRE-specific features (e.g. named backreferences (?P<name>), possessive quantifiers, atomic groups) may not be supported. Use the tool for logic verification; test flavor-specific features in the actual runtime.
- Q: Does this tool send my pattern or test string to a server?
- A: No. All processing is performed entirely in the browser. Your patterns and test strings are never sent to any server.
