Text & Encoding

Regex & pattern matching tools

A regex that works in one language often behaves differently in another, a .gitignore rule that silently doesn't match the file you expected, or a route pattern that needs testing before it ships — pattern matching bugs are easy to introduce and often hard to spot by reading the pattern alone. These tools let you test a pattern against real input and see exactly what matched, in the specific engine you're targeting.

Regex tester and Python regex tester run the actual JavaScript and Python engines rather than a generic approximation, so named groups, flags and replacements behave the way they will in your code. Regex flavor tester puts PCRE2 and RE2 side by side on the same expression, which matters since RE2 rejects backreferences that PCRE2 accepts. Gitignore tester explains the decision chain rule by rule, and Glob tester lets you choose between minimatch and picomatch semantics.

7 tools

Regex & Pattern Matching tools FAQ

Why does my regex work in JavaScript but fail in Python, or the other way around?

JavaScript and Python regex engines differ in named group syntax, lookbehind support history and a few escape sequences. Test the same pattern in Regex tester for JavaScript and Python regex tester for Python's re module to see the actual behavior in each engine instead of assuming they match.

Why doesn't my .gitignore rule match the file I expect?

Gitignore tester traces which rules apply to a path and shows the decision chain, since a later rule can re-include a file an earlier rule excluded, and patterns starting with / are anchored differently than ones without it. Testing the exact path against the exact rules beats re-reading the syntax rules from memory.

What's the difference between PCRE2 and RE2 regex engines?

RE2, used by Go and by tools like ripgrep, guarantees linear-time matching by refusing constructs like backreferences and unbounded lookaround that PCRE2 supports. Regex flavor tester runs the same expression against both, so you can see directly whether a pattern that works in PCRE2 is even valid in RE2.