PDFFlare

Regex Tester Online — 40+ Presets, Multi-Language

Free regex tester online — paste a regex, get live match highlighting plus code for 10 languages (JS, Python, Go, Java, Ruby). 40+ pattern presets.

PDFFlare's regex tester online is a free, browser-based tool for testing, debugging, and porting regex patterns. Drop in a pattern, see live match highlighting on your test string, get capture groups inspected in a table, and copy paste-ready code for 10 languages — JavaScript, TypeScript, Python, Java, Go, PHP, Ruby, C#, Rust, and Bash. The pattern library covers 40+ common patterns (email, URL, phone, IPv4, UUID, credit card, hex color, semver, JWT) so you don't have to write the common ones from memory. If you have data but no regex, jump to PDFFlare's Regex Generator first to infer a pattern from sample strings, then come back to test it.

Use it as a JavaScript regex tester for everyday match debugging, a regex match online for log file extraction, or a regex101 alternative that ships ad-free with code output for more languages. Pairs with PDFFlare's JWT Decoder (regex on JWT tokens often catches malformed signatures), the JSON Formatter (pretty-print before regex-extracting fields), and the UUID Generator for IDs you may want to validate with regex.

Acts as a regex pattern library for the patterns you hit weekly, a multi-language regex converter for porting regex between codebases, and a built-in regex cheat sheet for character classes, quantifiers, and lookarounds. Free, unlimited, no upload, no rate limits.

//g
5 matches
Highlighted matches:
Contact alice@example.com or bob@test.co.uk for details. Internal: support@pdfflare.com (orange brand) Bad: not-an-email Multi: charlie@sub.domain.io, dave+spam@gmail.com

Match details (5)

#MatchIndexGroups
1alice@example.com8
2bob@test.co.uk29
3support@pdfflare.com67
4charlie@sub.domain.io128
5dave+spam@gmail.com151
const re = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;
const matches = "your text".match(re) ?? [];
Pattern library — 40+ presets

Email

Web / URL

Phone

Date / Time

Network

IDs

Financial

Postal

US Gov IDs

Code / Markup

Numbers

Strings

What does this regex mean?
  • [a-zA-Z0-9._%+-] — character class
  • + — one or more of previous
  • "@" — literal text
  • [a-zA-Z0-9.-] — character class
  • + — one or more of previous
  • \. — literal "."
  • [a-zA-Z] — character class
  • {2,} — quantifier (exact / range)
Regex cheat sheet

Character classes

  • \d — digit (0-9)
  • \w — word char (a-z, 0-9, _)
  • \s — whitespace
  • . — any char (except newline)
  • [abc] — a, b, or c
  • [^abc] — NOT a, b, or c

Anchors & boundaries

  • ^ — start of string
  • $ — end of string
  • \b — word boundary
  • \B — NOT word boundary

Quantifiers

  • * — 0 or more
  • + — 1 or more
  • ? — 0 or 1
  • {n} — exactly n
  • {n,m} — n to m
  • *? — lazy (non-greedy)

Groups & lookarounds

  • (abc) — capture group
  • (?:abc) — non-capturing
  • (?<n>abc) — named group
  • (?=abc) — positive lookahead
  • (?!abc) — negative lookahead
  • a|b — alternation

How to Test a Regex

  1. Pick a preset or paste your regex

    Open the pattern library and click any of 40+ battle-tested presets — email, URL, phone, IPv4, UUID, credit card, hex color, JWT, semver, and more. Or paste your own regex. The tester accepts JavaScript-flavor regex (with named groups, lookaheads, lookbehinds where supported).

  2. Toggle flags as needed

    Click the g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode), y (sticky) flag chips. They update the regex literal display and re-run the match instantly. Hover any flag for a one-line description.

  3. Read live match highlights and capture groups

    Type or paste your test string and PDFFlare highlights every match in orange. The match details table below shows index, full match, and each capture group (with $1, $2, $3 labels). Empty matches and zero-width assertions are surfaced too.

  4. Copy code for your language

    Pick a target language from the Code snippet dropdown — JavaScript, TypeScript, Python, Java, Go, PHP, Ruby, C#, Rust, or Bash (grep -E). PDFFlare emits paste-ready code with proper escaping and the right flags translated for that language's regex API. Copy and drop into your codebase.

When Do You Need a Regex Tester Online?

Validating user input on a form: Email field, phone field, ZIP code, postal code, credit card. Open the pattern library, copy the right preset, paste into your validation library, done. PDFFlare ships honest patterns — the simple email regex catches 99% of real addresses, not the 500-character RFC 5322 monster that rejects valid edge cases.

Extracting fields from log files or text dumps: You have a 50 MB log dump and need every IPv4 address, every UUID, or every error stack trace header. Paste a sample, pick the right preset, copy the code snippet for your language, run it on the real file. Pair with the live match-count badge to gut-check whether the regex is matching too much or too little before committing to it.

Converting a regex from one language to another: You wrote it in JavaScript, your colleague needs it in Python or Go. PDFFlare emits paste-ready code in 10 languages with the right flag translation (re.IGNORECASE, Pattern.MULTILINE, inline (?i) flags) and the right escape rules. Saves the copy-paste-edit-debug cycle every time you port a regex.

Debugging a regex that's misbehaving in production: Your regex matches in tests but explodes in production logs. Often it's ReDoS (catastrophic backtracking) — the regex worked on benign input but a crafted string triggers exponential evaluation. PDFFlare's ReDoS detector flags nested-quantifier patterns ((a+)+, (a|aa)+) with a red warning. Pair with the substitution preview to see what the regex actually consumes.

Why Use PDFFlare's Regex Tester Online?

40+ Battle-Tested Pattern Presets

Email (simple + RFC 5322 lite), URL (with/without protocol), phone (US/UK/E.164), date (ISO/US/EU), IPv4, IPv6, MAC, UUID v4/any, JWT, ULID, credit card, currency, IBAN, postal codes, SSN, HTML tag, Markdown link, hex color, semver, file extension, and more. Categorized so you can browse by intent.

Multi-Language Code Output (10 Languages)

Paste-ready snippets for JavaScript, TypeScript, Python, Java, Go, PHP, Ruby, C#, Rust, and Bash (grep -E). Each snippet uses the right escape rules and translates flags (g/i/m/s) to the destination language's regex API. Drop straight into your codebase.

100% Browser-Based

Native JavaScript RegExp engine. No upload, no server, no logs. Open DevTools → Network and you'll see zero requests while testing. Safe for confidential test strings (logs with PII, internal data, prod samples).

No Signup Required

Free, unlimited, no account, no rate limits, no ads. Substitution mode, capture-group inspector, ReDoS detector, plain-English explanation pane, regex cheat sheet, recent-patterns history — all client-side, all included.

Frequently Asked Questions About Regex Generator and Tester