Test JavaScript regular expressions with realistic input
Build a pattern, select flags, and inspect full matches and capture groups against sample text. Start with representative positive and negative cases rather than one string that already matches.
Example input
Pattern: ^(?<name>[a-z][a-z0-9_-]{2,15})$
Text: api_user-7Expected output
Match: api_user-7 Group name: api_user-7
Behavior
- Uses JavaScript regular-expression syntax and flags.
- Global matching finds more than one non-overlapping result.
- Capture groups expose the exact subexpressions that matched.
Limits and edge cases
- JavaScript syntax differs from PCRE, RE2, .NET, and other engines.
- Nested ambiguous quantifiers can cause catastrophic backtracking.
- Regex is rarely the right parser for nested programming languages or HTML.
Processing note: tool input stays in the browser. Readme.now analytics records page usage, not the payload you paste or the generated output.
Authoritative reference: MDN regular expressions guide