Toolkernel
  • CSV
  • JSON
  • Regex
  • PDF
  • JWT
  • YAML
  • Cron
Toolkernel

Free, privacy-focused developer tools that run entirely in your browser.

  • ✓ 100% browser-based
  • ✓ No data uploaded
  • ✓ Free forever

JSON & CSV

  • JSON Formatter
  • JSON Compare
  • JSON Auto-Fix
  • CSV Cleaner & Merger
  • YAML Formatter

PDF Tools

  • Merge PDF
  • Split PDF
  • Compress PDF
  • PDF to Images
  • All PDF Tools

More Tools

  • Regex Tester
  • JWT Decoder
  • Cron Builder

© 2026 Toolkernel. All rights reserved.

Your files never leave your device. Built for developers who value privacy.

  1. Toolkernel
  2. /
  3. Regex Tools
  4. /
  5. Tester

Regex Tester & Debugger Online

Test patterns with live matching, explanations, and code generation

Your patterns and data never leave your device

🔍Regex Tester

Test regular expressions with live matching, explanations, and code generation

📖 Documentation
Regular Expression
//g
Test String0 matches found
Match Results
Enter a pattern to start matching

How to Test Regular Expressions

  1. 1
    Enter Your Pattern
    Type your regex pattern in the pattern input field. The tool validates the pattern in real-time and highlights any syntax errors before you even test.
  2. 2
    Set Flags
    Click the flag toggles to enable global (g), case-insensitive (i), multiline (m), or other flags. Each flag modifies how the pattern matches your text.
  3. 3
    Paste Test Text
    Enter the text you want to test against. All matches are highlighted instantly as you type, with captured groups shown in the results panel.
  4. 4
    Generate Code
    Switch to the Code tab to get ready-to-use regex code for JavaScript, Python, Go, or Java — with proper escaping and language-specific syntax.

Regex Flags Explained

Flags modify how a regular expression matches text. They appear after the closing slash in regex literals (e.g., /pattern/gi). Here's what each flag does:

g

Global

Find all matches in the string, not just the first one. Without this flag, the regex stops after the first match.

i

Case-Insensitive

Match letters regardless of case. For example, /hello/i matches "Hello", "HELLO", and "hello".

m

Multiline

Makes ^ match the start of each line and $ match the end of each line, not just the start and end of the entire string.

s

Dotall

Makes the dot (.) match any character including newline characters (\n). By default, dot matches everything except newlines.

u

Unicode

Enables full Unicode support. Correctly handles surrogate pairs and allows Unicode property escapes like \p{Letter}.

y

Sticky

Matches only at the exact position indicated by the lastIndex property. Useful for tokenizing or parsing input character by character.

Common Regex Patterns

These are the most frequently used regex patterns. The built-in pattern library in the tool has 20+ patterns you can load with one click.

Pattern NameRegexDescription
Email Address[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}Matches standard email addresses
URLhttps?://[\w.-]+(?:\.[\w.-]+)+[\w.,@?^=%&:/~+#-]*Matches HTTP and HTTPS URLs
IPv4 Address\b(?:\d{1,3}\.){3}\d{1,3}\bMatches IPv4 addresses like 192.168.1.1
Phone Number\+?\d{1,3}[-.\s]?\(?\d{1,4}\)?[-.\s]?\d{1,4}[-.\s]?\d{1,9}Matches international phone numbers
Date (YYYY-MM-DD)\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])Matches ISO 8601 date format
Hex Color#(?:[0-9a-fA-F]{3}){1,2}\bMatches hex color codes like #fff or #a1b2c3
HTML Tag<([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>.*?</\1>Matches opening and closing HTML tags
Strong Password(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}At least 8 chars with upper, lower, digit, and special

Troubleshooting Common Regex Issues

Greedy vs. Lazy Matching

Quantifiers like *, +, and ? are greedy by default — they match as much text as possible. This often causes unexpected results when parsing HTML or quoted strings. Add ? after the quantifier to make it lazy (match as little as possible).

Greedy: <.*> matches entire "<b>bold</b>"
Lazy: <.*?> matches "<b>" then "</b>"

Escaping Special Characters

Characters like . * + ? ^ $ { } [ ] ( ) | \ have special meaning in regex. To match them literally, prefix with a backslash. For example, use \. to match a period, \$ to match a dollar sign, and \\ to match a backslash.

Multiline Matching

By default, ^ and $ match only the very start and end of the entire input string. Enable the multiline flag (m) to make them match at the start and end of each line. If you also need . to match newline characters, enable the dotall flag (s).

Safe for Sensitive Data

Your regex patterns and test strings are processed entirely in your browser. Unlike other online testers that send your data to servers, we never upload anything. This makes it safe to test patterns against log files, API keys, or any confidential text.

No data uploaded to any server
Works offline after page load
No account required
No data logging or tracking

Frequently Asked Questions

How do I test a regex pattern online?

Enter your regex pattern in the pattern field, set any flags (global, case-insensitive, etc.), and paste your test text. Matches are highlighted in real-time as you type. The results panel shows each match with its position and any captured groups.

What do regex flags mean?

Regex flags modify how the pattern matches. Global (g) finds all matches instead of just the first. Case-insensitive (i) ignores letter case. Multiline (m) makes ^ and $ match line boundaries. Dotall (s) makes . match newlines. Unicode (u) enables full Unicode matching. Sticky (y) matches only at the current position.

How do I capture groups in regex?

Use parentheses to create capture groups: (pattern). For named groups, use (?<name>pattern). The results panel shows each group's matched text and position. You can reference groups in replacements with $1, $2, etc., or $<name> for named groups.

Can I generate regex code for other programming languages?

Yes. The code generator produces ready-to-use regex code for JavaScript, Python, Go, and Java, with proper escaping and language-specific syntax. Each generated snippet includes the pattern, flags, and a working example.

What is the difference between greedy and lazy matching?

Greedy quantifiers (*, +, ?) match as much text as possible. Lazy quantifiers (*?, +?, ??) match as little as possible. For example, given '<b>bold</b>', the pattern <.*> greedily matches the entire string, while <.*?> lazily matches just <b>. Add ? after a quantifier to make it lazy.

Is my test data private when using this tool?

Yes. All regex processing happens 100% in your browser. Your patterns and test data are never sent to any server. This makes it safe to test patterns against sensitive text like log files, API responses, or personal data.

How do I escape special characters in regex?

Special regex characters (. * + ? ^ $ { } [ ] ( ) | \) must be escaped with a backslash to match literally. For example, to match a period, use \. instead of just a period. To match a backslash itself, use \\.

What common patterns are available in the pattern library?

The built-in pattern library includes 20+ ready-to-use patterns for email validation, URLs, phone numbers, IP addresses (IPv4 and IPv6), dates, passwords, credit card numbers, HTML tags, hex colors, and more. Click any pattern to load it into the tester.

Related Tools

Regex Documentation

Full guide to regular expressions

JSON Formatter

Format and validate JSON data

CSV Tools

Clean, merge, and transform CSV files