🔒 Security-first IT & cloud for Central Oregon 541-508-8797  |  ✉ support@thelocalgeekshop.com

Regex Tester

Home / Free Tools / Regex Tester

Which flavour of regex is this?

JavaScript's, because it runs in your browser. That matters — regex dialects genuinely differ, and a pattern that works here may not work identically in PowerShell (.NET), grep (POSIX), Python or PCRE.

The differences that bite most often: lookbehind (?<=...) works in modern JavaScript and .NET but not in POSIX grep; named groups are (?<name>...) in JavaScript and .NET but (?P<name>...) in Python; and \d is Unicode-aware in some engines and ASCII-only in others.

The patterns worth knowing

A word of caution about validating things with regex

Regex is excellent at extracting and terrible at validating anything with real grammar. The IP pattern in the example above matches 999.999.999.999 quite happily — it checks shape, not validity. Email is worse: the fully correct RFC 5322 pattern is thousands of characters long and still does not tell you the address exists.

For those, match loosely to extract, then validate properly in code. Our subnet calculator does real IP validation rather than a shape check, which is why it rejects 255.255.0.255 as a mask.

Catastrophic backtracking

Nested quantifiers over the same characters — the classic being (a+)+$ — can take exponential time on input that nearly matches. That is a real denial-of-service vector if the pattern runs on user input server-side. If a pattern here appears to hang, that is what you are looking at, and it is worth knowing before it ships.

Need a hand with the thing you're troubleshooting?

We do managed IT, networking and security for businesses across Central Oregon.

Managed IT Services Call 541-508-8797