Practical example
Test ^[A-Z]{2}-\d{4}$ against both AB-1234 and AB-1234 followed by a newline; anchors can behave differently with multiline options.
Enter a regex pattern, flags, and input text. Toolinix will highlight matches and list them.
Common flags: g i m s u
One match per line.
Matches are highlighted.
A regular expression (regex) is a pattern used to search, match, or extract parts of text.
This tool runs in your browser and helps you test patterns quickly without sending data to a server.
A pattern that matches one example may still reject valid input, accept invalid input, or become slow on adversarial text.
Test representative matches, near misses, empty values, multiline input, Unicode text, and unusually long strings.
Verify case, global, multiline, dot-all, anchors, word boundaries, and whether the pattern must match the full value.
Check numbered and named groups against the code that consumes them, especially after adding optional or nested groups.
Avoid ambiguous nested quantifiers and test failure cases for excessive backtracking before accepting untrusted input.
Test ^[A-Z]{2}-\d{4}$ against both AB-1234 and AB-1234 followed by a newline; anchors can behave differently with multiline options.
Nested quantifiers such as (a+)+ can cause catastrophic backtracking on a long near-match and freeze a production request.
A small set of positive, negative, and worst-case samples is more useful than one expression that only passes the happy path.
You may also find these tools useful.