Explore all Text & Data Tools

Regex Tester & Debugger – Test Regular Expressions Online

Test and debug JavaScript regular expressions in real time with visual match highlighting, capture groups breakdown, and syntax cheat sheet.

Smart Regex Generator from Requirement:
Enter prompt in English or Vietnamese
⚡ Quick Prompts:
RunMacro Preset Library (24+):
//gim
Flags:
Visual Matches Highlight:2 matches
Contact support@runmacro.app or billing.team_99@company.co.uk for help. US hotline: +1-800-555-0199 or UK office: +44 20 7946 0991. Your security OTP is 852109 and expires at 14:30. Invoice total: $250.00, discount: $15.50. Plan: "Pro Automation". Order #RM-9821, transaction ID: 6ba7b810-9dad-11d1-80b4-00c04fd430c8.
Captured Matches & Groups (2):
#IndexFull MatchCapture Groups
#18support@runmacro.app
$1: support$2: runmacro.app
#232billing.team_99@company.co.uk
$1: billing.team_99$2: company.co.uk
RunMacro Bot
⚡ Automated Regex Scraping

Automate Regex Scraping & Data Pipeline Routing

Tested your regular expression? Now deploy it to extract invoice numbers, emails, and tracking codes from live windows.

How to Test Regular Expressions Online

1

Enter Regex Pattern and Flags

Type your regular expression into the pattern input bar and select appropriate flags like global (g) or ignoreCase (i).

2

Paste Text to Inspect Matches

Paste your sample data into the Test String box. Matches will instantly light up in yellow/neon highlights.

3

Review Groups and Copy Results

Inspect the captured groups table below to view exact group values ($1, $2) and copy all matches with one click.

Realistic Regular Expression Testing Scenarios

Evaluating pattern matches, capture groups, and replacement tokens in real time.

Validating International E.164 Phone Format

Example 1
Configuration:Pattern: ^\+[1-9]\d{1,14}$ | Flags: g, m.
Input Data
+15550143
0987654321
+84901234567
Output Result
Matches: "+15550143" (Line 1) and "+84901234567" (Line 3). "0987654321" rejected (missing leading + prefix).
Analysis & Interpretation: Accurately validates international telephony standards for automated CRM entry.

Regex Flags & Token Explanations

Understanding global, case-insensitive, multiline, and dotAll modifiers.

Flags (g, i, m, s, u)

g (Global match all), i (Case-insensitive), m (Multiline ^ and $ anchor lines), s (dotAll . matches newlines).

Impact: Configures JavaScript RegExp execution behavior.

Essential Regular Expression Patterns & Syntax Reference

Quick reference table of essential JavaScript regex tokens, quantifiers, capture groups, and production-tested patterns for web scraping and data validation:

CategoryPattern / SyntaxDescriptionExample Match
Character Classes\d, \w, \sMatches any digit (0-9), word character (a-z, A-Z, 0-9, _), or whitespace (space, tab, newline).\d+ matches "2024", \w+ matches "run_macro"
Quantifiers*, +, ?, {n,m}Matches 0 or more (*), 1 or more (+), 0 or 1 (?), or between n and m occurrences.a{2,4} matches "aa", "aaa", "aaaa"
Anchors & Boundaries^, $, \b^ asserts line start, $ asserts line end, \b asserts word boundary.^\d+$ matches whole line containing digits only
Capture Groups(abc), (?:abc)Parentheses group tokens together; captures content into $1, $2, or creates non-capturing group with (?:...).(\w+)@(\w+) extracts username & domain prefix
Common Pattern: Email([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})Standard RFC-friendly pattern to validate and extract email user & domain parts.user@runmacro.app (Group 1: user, Group 2: runmacro.app)
Common Pattern: URLhttps?:\/\/[^\s$.?#].[^\s]*Matches HTTP and HTTPS URLs for web scraping and link extraction.https://runmacro.app/en/tools/
Common Pattern: Date (ISO)\b\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])\bValidates standard YYYY-MM-DD format with month and day boundary enforcement.2026-03-31
Common Pattern: Price/Currency\$?(\d{1,3}(,\d{3})*(\.\d{2})?)Parses monetary amounts with optional dollar sign, comma thousands, and cents.$1,499.00 or 250.50

Catastrophic Backtracking & ReDoS Prevention

Avoiding exponential regex evaluation on nested quantifiers.

Catastrophic Backtracking (ReDoS Protection)

Patterns with nested quantifiers (e.g. (a+)+$) can freeze browser threads when evaluated against non-matching strings.

Recommended Workaround: Use atomic groups or possessive quantifiers where available, and avoid nested wildcards.

Key Capabilities of Regex Tester

Real-Time Match Highlights

Visual marks instantly highlight matching text strings as you type.

Capture Group Breakdown

Inspect full matches alongside numbered capture groups ($1, $2...) in a structured table.

Built-in Syntax Cheat Sheet

Quickly reference character classes, quantifiers, anchors, and lookarounds.

Ready-to-Use Presets

One-click presets for common expressions including Email, URL, Hashtag, and Date patterns.

Frequently Asked Questions

Clear answers about using this tool and automating workflows with RunMacro.

Which regular expression engine does this tool use?

The tool uses the native ECMAScript / JavaScript RegExp engine built into modern web browsers, supporting standard character classes, quantifiers, lookaheads, lookbehinds, and capture groups.

What are Capture Groups in regular expressions?

Capture groups are defined by enclosing parts of your regex pattern in parentheses `(...)`. They allow you to extract specific substrings (accessible via $1, $2, etc.) from matched patterns during parsing or string replacement operations.

What does the "g" (global) flag do?

The global flag (`g`) instructs the regex engine to search for all matching occurrences throughout the entire input string rather than stopping after the first match.

How does RunMacro utilize regex in web automation?

RunMacro Web Automation uses regular expressions within Smart Selectors to extract dynamic text strings, parse order numbers, validate input fields, and sanitize scraped HTML data before saving to spreadsheets.

Related Free Tools

Explore other helpful browser-based utilities in the same category.