🎯 Regex Tester & Matcher
Test JavaScript regular expressions with flags and match inspection.
Match Results
Share a sample
Typing stays on this page. A shared link includes your pattern and test text, so use a non-sensitive example.
Using Regex Tester & Matcher
Build and debug a JavaScript regular expression against real sample text, such as extracting phone numbers from a log or validating an order code, before putting it in code.
How to use it
- Type the pattern without surrounding slashes, for example \d{3}-\d{4} rather than /\d{3}-\d{4}/.
- Enter flags: g finds every match, i ignores case, m makes ^ and $ work per line.
- Paste representative text into Test String and read each match with its index and any named groups.
- Use Preview share link to get a URL containing the example, and read the included text before copying it.
Worked example
- Input and settings
- Pattern \b\d{3}-\d{4}\b, flags g, text "Call 555-0199 or 555-0142."
- Expected result
- 2 matches: 555-0199 at index 5 and 555-0142 at index 17.
Limits and common mistakes
- This uses JavaScript's regex engine; lookbehind, Unicode classes and flags behave differently in PCRE, Python or Java.
- A pattern that runs longer than 1.5 seconds is stopped, which catches catastrophic backtracking such as (a+)+$.
- At most 1,000 matches are listed.
- A share link carries your test text after the # sign, so it is not sent to the server, but anyone who has the link can read it.
Found a mismatch? Report a problem with a non-sensitive example. Read our privacy information before sharing inputs or links.
🔗 Related Tools
Bcrypt Hash & Compare
Generate bcrypt password hashes with configurable salt rounds and verify candidate passwords directly in your browser.
Check My IP & Network Diagnostics
Detect public IPv4/IPv6 address, ISP, Autonomous System (ASN), country, geolocation, and client connection diagnostic metrics.
Color Picker & Converter
Convert color values seamlessly between HEX, RGB, HSL, and HSV with a visual palette and contrast rating.
Cron Expression Parser & Explainer
Translate cron schedule expressions into clear plain English and preview the next upcoming execution timestamps.