Regex Tester — Test Regular Expressions Online Free

Free online regex tester. Test JavaScript regular expressions with live match highlighting, capture groups, and flags. No signup, runs in your browser.

How to use

  1. Enter Pattern — Type your regular expression pattern (without delimiters)
  2. Set Flags — Toggle flags like global (g), case-insensitive (i), multiline (m)
  3. Test — Enter test text and see matches highlighted in real time

What Is a Regex Tester?

A regex tester lets you write a regular expression pattern, apply it to test text, and immediately see which parts of the text match. This real-time feedback loop makes it dramatically easier to develop and debug regular expressions compared to testing them in code.

Regular expressions (regex) are patterns used to match character combinations in strings. They're supported in virtually every programming language and are essential for text processing, validation, search, and data extraction.

How to Use Regular Expressions

Regular expressions use a concise syntax to describe text patterns:

  • Literals: hello matches the exact text "hello"
  • Character classes: [aeiou] matches any vowel, \\d matches any digit
  • Quantifiers: + (one or more), * (zero or more), {3} (exactly 3)
  • Anchors: ^ matches start of line, $ matches end of line
  • Groups: (abc) captures "abc" as a group, (?:abc) is non-capturing
  • Alternation: cat|dog matches "cat" or "dog"

Common Regex Patterns

Email validation: [\\w.-]+@[\\w.-]+\\.\\w+

Phone number: \\(?\\d{3}\\)?[-.\\s]?\\d{3}[-.\\s]?\\d{4}

URL: https?://[\\w.-]+(/[\\w.-]*)*

IP address: \\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b

Regex Flags Explained

  • g (global): Find all matches, not just the first one
  • i (case-insensitive): /hello/i matches "Hello", "HELLO", "hElLo"
  • m (multiline): ^ and $ match at line boundaries, not just string start/end
  • s (dotall): Makes . match newline characters too

Capture Groups

Parentheses create capture groups that extract parts of the match. For example, (\\d{4})-(\\d{2})-(\\d{2}) applied to "2024-01-15" captures "2024", "01", and "15" as separate groups. This tool displays group values for each match.

Privacy

All regex testing runs locally in your browser using JavaScript's native RegExp engine. No patterns or test data are transmitted to any server.

Process matched text with our Text Case Converter. Validate data formats with our JSON Validator.

Frequently asked questions

Do I need to add / delimiters?

No. Enter the pattern without delimiters. For example, enter \\d+ instead of /\\d+/g. Use the flag toggles to set flags.

What flags are available?

Global (g) finds all matches. Case-insensitive (i) ignores case. Multiline (m) makes ^ and $ match line boundaries. Dotall (s) makes . match newlines.

Does it show capture groups?

Yes. Each match displays its capture groups (if any) with group indices and values.

Is there a match limit?

Yes. The tool stops after 1,000 matches to prevent infinite loops with patterns that match empty strings.

Is my data private?

Yes. All regex testing runs in your browser. No data is sent to any server.

Related free tools

  • XML Formatter & Minifier — Beautify or minify any XML — SOAP, RSS, SVG, sitemap. Browser-based parser.
  • XML to JSON Converter — Parse any well-formed XML into a clean JSON tree with attributes and arrays.
  • JSON to XML Converter — Convert JSON to well-formed XML — supports attributes, custom root, declaration.
  • CSV Viewer — Open CSV or TSV files in your browser — sort, search, paginate, export filtered view.
  • JSON to CSV Converter — Convert JSON data to CSV format. Export to spreadsheets easily.
  • CSV to JSON Converter — Convert CSV data to JSON format. Useful for API development.
  • JSON Formatter — Format, beautify, or minify JSON with customizable indentation.
  • JSON Validator — Validate JSON syntax and find errors with line and column numbers.
  • HTML Minifier — Compress HTML by removing comments, whitespace, and line breaks.
  • CSS Minifier — Minify CSS by stripping comments, whitespace, and unnecessary characters.
  • JavaScript Minifier — Compress JavaScript by removing comments, whitespace, and empty lines.
  • Base64 Encoder/Decoder — Encode text to Base64 or decode Base64 back to text. UTF-8 support.

Browse all free tools · Guides and tutorials · PDF tools · Developer tools · Text tools · SEO tools