🔍

Regex Tester

Test regular expressions with live match highlighting, group capture and a built-in library of 20 common IT patterns.

Pattern
Regular Expression
/ /
Test String
Enter a pattern and test string
Highlighted Matches
Match Details
Common Patterns Library

About the Regex Tester

Regular expressions are a powerful tool for matching, searching and validating text patterns. They are used in log analysis, input validation, configuration parsing, scripting and security monitoring. This tool gives you live match highlighting as you type both the pattern and the test string, with group capture results shown below for each match.

The built-in pattern library includes 20 pre-built patterns covering common IT use cases: IPv4 and IPv6 addresses, MAC addresses, CIDR notation, URLs, email addresses, UUIDs, Windows Event IDs, Active Directory usernames, PowerShell EncodedCommand arguments and more. Click any pattern to load it instantly.

Common Use Cases

  • 📋
    Log file parsing. Extract IP addresses, timestamps, error codes or usernames from Windows Event Viewer exports, IIS logs, syslog or application logs.
  • 🛡️
    Security monitoring. Write SIEM detection rules for PowerShell encoded commands, suspicious URL patterns, credential formats or known attack strings.
  • Input validation. Test and debug validation patterns for email addresses, phone numbers, IP addresses, hostnames and custom formats before adding them to application code.
  • 📝
    Text processing scripts. Build and test patterns for PowerShell, Python or Bash scripts that extract, replace or validate text data.

Frequently Asked Questions

Which regex flavour does this tool use?
JavaScript regex syntax, which is close to PCRE (Perl Compatible Regular Expressions) used by Python, PHP and most modern languages. The main differences are that JavaScript uses different syntax for named groups and does not support lookbehind in older browsers. All patterns in the library are tested against the JavaScript engine.
What do the flags g, i, m mean?
g (global) finds all matches instead of stopping at the first. i (case-insensitive) matches regardless of uppercase or lowercase. m (multiline) makes ^ and $ match at line boundaries rather than only at the start and end of the whole string. The gi combination is the most commonly useful for log analysis.
Why do my capture groups show as undefined?
Capture groups only appear in results when they actually participate in a match. If your pattern has optional groups (using ?) that did not match in a particular result, those groups show as undefined. This is expected JavaScript regex behavior.