Complete Regular Expression Syntax Guide
Regular expressions (Regex) are powerful pattern-matching strings used across software engineering, data cleaning, logs analysis, and web scraping.
Common Pattern Syntax Cheatsheet
^/$— Start and end of line anchors.[a-zA-Z0-9]— Character set matching any single alphanumeric character.[^0-9]— Negated character set (matches anything except digits).(group)— Capturing group for substring extraction.(?:group)— Non-capturing group.(?=...)/(?!...)— Positive and negative lookahead assertions.
Regex Flags Reference
g(Global): Don't return after first match; find all occurrences.i(Insensitive): Case-insensitive matching.m(Multiline):^and$match start/end of each line.s(DotAll): Allows dot (.) to match newline characters.
Frequently Asked Questions
Which regex engine flavor does this tester use?
This tool uses native ECMAScript (JavaScript ES2024) regular expression syntax with support for standard flags: global (g), case-insensitive (i), multiline (m), dotAll (s), unicode (u), and sticky (y).
What do \d, \w, and \s match in Regular Expressions?
`\d` matches any digit (0-9), `\w` matches any word character (letters A-Z, numbers 0-9, and underscore _), and `\s` matches whitespace (space, tab, line break).
What is the difference between greedy and lazy matching?
Greedy matchers (`*`, `+`) expand to match as much text as possible. Adding a question mark (`*?`, `+?`) makes them lazy, matching as few characters as possible.
How do I validate an email address using Regex?
A standard email validation pattern is: `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`
Is my input text or pattern sent to a server?
No. All regex matching, substring evaluation, and group parsing execute 100% locally in your browser JavaScript thread. Your data is completely private.