Regex Tester

/g

Test String & Result

This is a sample test string with several five-letter words. Email me: hello@example.com or visit https://onlinetextlab.com.

Regex Cheat Sheet

Character Classes
.Any character except newline
\dDigit (0-9)
\DNot a digit
\wWord character
\WNot a word character
\sWhitespace
\SNot whitespace
Anchors
^Start of string
$End of string
\bWord boundary
\BNot a word boundary
Groups and Lookarounds
(abc)Capture group
(?:abc)Non-capturing group
(?=abc)Positive lookahead
(?!abc)Negative lookahead
Quantifiers
a*0 or more
a+1 or more
a?0 or 1
a{3}Exactly 3
a{2,}2 or more
a{1,4}1 to 4
Flags (Modifiers)
gGlobal
iCase-insensitive
mMulti-line (^ and $ match line boundaries)
sDotAll (dot matches newline)
uUnicode
ySticky

Matches (5)

MatchStartEndGroups
words5459
Email6166
hello7176
visit9297
https98103

Regex Explanation

\bWord boundary
\wWord character (a-z, A-Z, 0-9, _)
{5}Exactly 5 times
\bWord boundary

Snippets

No saved snippets yet.

TL;DR — write a regex, paste text, see matches live

Type a pattern, toggle flags, and preview Match, Replace, or Split in real time. See start/end indexes and capture groups, export CSV, and save snippets. Runs 100% in your browser.

Regex Tester — free online regular expression testing tool

A fast, no‑login online regex tester for everyday regular expression testing. Type a pattern, toggle flags, and watch matches highlight instantly. Switch tabs to preview Match, Replace, or Split. The matches panel lists each hit with start/end indexes and capture groups, so you can debug quickly without leaving the browser.

Prefer a regex creator feel? Use presets (email, URL, dates, phone, IPv4), read the token‑by‑token explanation, and skim the built‑in cheat sheet. Save your own snippets for reuse or export results to CSV. Everything runs locally with the JavaScript RegExp engine, making this a practical regex checker, editor, and quick builder in one.

Applying patterns to full documents? Try Find & Replace. Extracting web addresses? Use the URL Extractor. Cleaning inputs first? Text Cleaner helps a ton.

Quick start

  1. Enter a pattern (e.g. /\\w+/g or just \\w+) and toggle flags (g, i, m, s, u, y). Or pick a preset to begin faster.
  2. Paste a test string. Use Match to highlight hits, Replace to preview substitutions (with $1, $2 …), or Split to segment text.
  3. Inspect the Matches table for indexes and groups, export CSV, copy your pattern, or save a named snippet for later.

Key features

  • Live Match / Replace / Split previews
  • Start & end indexes plus capture groups for each hit
  • Token‑by‑token explanation of your pattern
  • Presets: email, URL, date, phone, IPv4
  • Cheat sheet and user‑saved snippets
  • CSV export of matches; one‑click copy of regex and results
  • Undo/redo for pattern edits; flag toggles (g/i/m/s/u/y)
  • 100% client‑side — fast, private, and offline‑friendly

Tips

  • Start simple; add anchors (^, $) and quantifiers gradually.
  • Use non‑capturing groups (?: … ) when you don’t need backreferences.
  • Prefer explicit character classes over dots when possible.
  • Test edge cases: empty lines, Unicode, and newlines (try the s and m flags).
  • Beware zero‑length matches; ensure your pattern advances through the string.

Frequently asked questions

Which regex flavor does this use?
The tool uses the JavaScript RegExp engine in your browser. Many patterns are portable, but flavors differ—confirm in your target runtime.
Can I use it as an online regex builder?
Yes—the presets, explanation panel, and cheat sheet make it a lightweight regular expression builder. Tweak and see results instantly.
Why don’t my results match another tester?
Engines and defaults vary (e.g., dotAll, multiline, Unicode). Double‑check flags and flavor specifics when comparing.
Is my data private?
Yes—everything runs locally; nothing is uploaded.

You might also like

Last updated: Aug 12, 2025