// IT TOOLS & CALCULATORS
| 100+ TOOLS
🔎 REGULAR EXPRESSION TESTER
// Test and debug regex patterns live with match highlighting and group capture
ADVERTISEMENT
[ IN-CONTENT AD ]

Regex Tester

Write a pattern, paste a test string, see every match highlighted with capture groups broken out — no reloading, no separate script just to check whether a regex actually does what you think it does. JavaScript regex syntax, with the standard g/i/m flags.

Patterns worth keeping around

  • IPv4: (\d{1,3}\.){3}\d{1,3}
  • Email: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} — good enough for validation UX, not a substitute for actually sending a verification email
  • MAC address: ([0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2}
  • ISO date: \d{4}-\d{2}-\d{2}
  • Log timestamp: \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2} — the starting point for pulling structure out of an otherwise unstructured log line

The flags, since they're easy to forget

  • g — find every match, not just the first one
  • i — case-insensitive
  • m — makes ^ and $ match the start/end of each line instead of the whole string, which matters a lot when you're matching against multi-line log output

Where regex actually earns its reputation

Log parsing is the big one — pulling IPs, timestamps and error codes out of unstructured text is most of what SIEM tools and log pipelines are doing under the hood. It's also everywhere in day-to-day shell work through grep and sed, in form validation, and in CI pipelines parsing build output to decide pass/fail. The reputation regex has for being unreadable is mostly earned by patterns written once and never revisited — a comment above a non-trivial regex explaining what it's actually matching saves the next person (often future you) a genuinely painful few minutes.