🔘 Regex builder
//g
📘 Regex Cheatsheet
Character Classes
.Any character except newline\dDigit (0-9)\wWord character (a-z, A-Z, 0-9, _)\sWhitespace\DNon-digit\WNon-word character\SNon-whitespace
Anchors
^Start of string/line$End of string/line\bWord boundary\BNon-word boundary
Quantifiers
*0 or more+1 or more?0 or 1{n}Exactly n{n,}At least n{n,m}Between n and m
Groups & Lookarounds
(abc)Capturing group(?:abc)Non-capturing group(?=abc)Positive lookahead(?!abc)Negative lookahead
Alternation & Sets
a|ba or b[abc]Any of a, b, c[^abc]Not a, b, or c[a-z]Range: a to z
Flags
gGlobal searchiCase-insensitivemMulti-linesDot matches newline
Frequently Asked Questions (FAQs)
A regular expression (regex) is a pattern used to match character combinations in strings. It's commonly used for searching, validating, and manipulating text.
Enter your regex in the 'Regular Expression' field and a test string in the 'Test String' field. The tool will highlight matches in real-time and show the total number of matches found.
The 'g' flag stands for 'global', which means the regex will find all matches in the test string, not just the first one.
Ensure your regex syntax is valid and that the pattern actually matches part of the test string. If no match is found, a red warning will be displayed.
Currently, this tool uses the 'g' flag by default. In future updates, additional flag toggles like 'i' (case-insensitive) and 'm' (multiline) may be supported.
The cheatsheet offers a quick reference to common regex patterns, character classes, anchors, quantifiers, and flags to help you build and understand regular expressions.
No. This tool runs completely in the browser and does not store or send any of your input data to a server.