Regex Tester & Debugger
Test and debug JavaScript regular expressions online. Real-time match highlighting, capture group extraction, and regex replace.
Recently Used Tools
No matches found.
Mastering Regular Expressions (Regex)
Regular Expressions (Regex) are powerful search patterns used to parse, validate, extract, and replace strings across virtually all programming languages. Standardized by the ECMAScript specification in JavaScript, regex patterns allow developers to express complex string matching rules in compact syntax.
Core Syntax Components
- Character Classes:
\d(digits 0-9),\w(word characters),\s(whitespace characters),.(any character except newline). - Quantifiers:
*(0 or more),+(1 or more),?(0 or 1),{n,m}(between n and m times). - Anchors:
^(start of line/string),$(end of line/string),\b(word boundary). - Capture Groups: Parentheses
(...)create numbered capture groups accessible in replacement operations via$1,$2.
JavaScript Regex Flags
Flags appended to the end of a regular expression alter its search behavior:
g(Global): Matches all occurrences in the string rather than stopping after the first match.i(Ignore Case): Case-insensitive matching (e.g./abc/imatchesABC).m(Multiline): Causes^and$to match the start and end of individual lines rather than the entire string.s(dotAll): Allows the dot.character to match newline characters (\n).u(Unicode): Enables full Unicode code-point matching for emojis and international scripts.
In-Browser Debugging Privacy
When debugging regex against server log entries, database credentials, or email dumps, using server-side online regex tools exposes sensitive log data. FreeFileTool evaluates regex patterns locally in your browser, keeping your text 100% private.
Frequently Asked Questions
Is my test data or regex pattern uploaded to any server?
No. FreeFileTool tests and evaluates regular expressions using your browser's native JavaScript RegExp engine in local RAM. Zero regex patterns or test strings are transmitted.
What JavaScript regex flags are supported?
This tool supports all standard ECMAScript flags: g (global search), i (case-insensitive), m (multiline mode), s (dotAll mode to match newlines), and u (unicode support).
How do capture groups work in replacement strings?
You can reference captured parenthetical groups in your replacement string using $1, $2, $3, etc., or use $& to insert the full matched string.
What causes Catastrophic Backtracking in regex?
Catastrophic backtracking occurs when nested quantifiers (e.g. (a+)+$) force the engine to evaluate exponential permutations on non-matching strings. Our browser tester is sandboxed to keep your browser tab responsive.