Regex Tester

    Test and debug regular expressions with real-time feedback.

    Regex Pattern

    Test String

    Matches

    Matches will appear here...

    Highlighted Matches

    Highlighted text will appear here...

    How to Use the Regex Tester

    Enter a regular expression pattern in the top field and a test string in the text area below. The tool will automatically highlight all matches and display detailed information about each match, including captured groups.

    Features

    • Real-time Testing - See matches update instantly as you type your pattern or test string.
    • Match Highlighting - Visualize matches directly in your test string with clear highlighting.
    • Regex Flags Support - Toggle various regex flags like global, case-insensitive, multiline, and more.
    • Capture Groups - View and analyze captured groups from your regular expressions.

    Common Regex Patterns

    Email Address
    [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}

    Match valid email addresses.

    URL
    https?://(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)

    Match web URLs including http and https protocols.

    Phone Number
    \+?\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}

    Match various phone number formats with optional country codes.

    Date (YYYY-MM-DD)
    \d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])

    Match dates in ISO format (YYYY-MM-DD).

    Regex Flags Explained

    • g
      Global search - find all matches rather than stopping after the first match.
    • i
      Case-insensitive search - ignore differences between uppercase and lowercase letters.
    • m
      Multiline mode - ^ and $ match the start/end of each line, not just the whole string.
    • s
      Dot matches all - allows . to match newline characters.
    • u
      Unicode support - treat pattern as a sequence of Unicode code points.
    • y
      Sticky mode - match at the current position in the target string only.

    Related Tools

    JSON Formatter

    Format, validate, and beautify your JSON data with this free online JSON formatter. Features include JSON validation, beautification, and minification.

    Use Tool

    Base64 Encoder/Decoder

    Encode text to Base64 or decode Base64 to text with this free online Base64 encoder/decoder tool.

    Use Tool

    HTML Minifier

    Compress HTML by removing whitespace, comments, and more with this free online HTML minifier tool.

    Use Tool