Regex Cheat SheetA complete reference for JavaScript regular expression syntax. Click any token to try it in the regex tester.Character Classes.Any character except newline\dDigit (0-9)\DNot a digit\wWord character (a-z, A-Z, 0-9, _)\WNot a word character\sWhitespace (space, tab, newline)\SNot whitespace[abc]Any of a, b, or c[^abc]Not a, b, or c[a-z]Character range a to zQuantifiers*Zero or more+One or more?Zero or one (optional){n}Exactly n times{n,}n or more times{n,m}Between n and m times*?Zero or more (lazy)+?One or more (lazy)??Zero or one (lazy)Anchors^Start of string (or line with m flag)$End of string (or line with m flag)\bWord boundary\BNot a word boundaryGroups & References(abc)Capturing group(?:abc)Non-capturing group(?<name>abc)Named capturing group\1Backreference to group #1\k<name>Backreference to named group(a|b)Alternation (a or b)Lookaround(?=abc)Positive lookahead(?!abc)Negative lookahead(?<=abc)Positive lookbehind(?<!abc)Negative lookbehindEscape Sequences\\Literal backslash\nNewline\rCarriage return\tTab\0Null character\xhhHex character\uhhhhUnicode characterFlagsgGlobal — find all matchesiCase-insensitivemMultiline — ^ and $ match line boundariessDotAll — . matches newlinesuUnicode — full Unicode supportvUnicode sets — extended character classesdIndices — capture start/end positionsReplacement Tokens$1, $2...Captured group by numberlt;name>Captured group by nameamp;Entire match Text before the match#x27;Text after the match$Literal dollar signTry the Regex Tester