असेंबली और डिसअसेंबली
आर्म कन्वर्टर
X86 कन्वर्टर
Mips कन्वर्टर
PowerPC कन्वर्टर
कनवर्टर
दिनांक और समय कन्वर्टर
पूर्णांक आधार परिवर्तक
रोमन अंक कन्वर्टर
Base64 स्ट्रिंग एनकोडर/डीकोडर
Base64 फ़ाइल कन्वर्टर
रंग कन्वर्टर
पाठ से ASCII बाइनरी
पाठ से यूनिकोड
YAML से JSON कन्वर्टर
YAML से TOML
JSON से YAML कन्वर्टर
JSON से TOML
TOML से JSON
TOML से YAML
XML to JSON
JSON to XML
Markdown to HTML
क्रिप्टो
टोकन जनरेटर
हैश टेक्स्ट
Bcrypt
UUID जनरेटर
ULID जनरेटर
टेक्स्ट एन्क्रिप्ट / डिक्रिप्ट करें
BIP39 पासफ़्रेज़ जनरेटर
HMAC जनरेटर
RSA कुंजी जोड़ी जनरेटर
पासवर्ड स्ट्रेंथ विश्लेषक
PDF हस्ताक्षर परीक्षक
वेब
URL एन्कोडर/डिकोडर
HTML एंटिटी एस्केप करें
URL पार्सर
डिवाइस जानकारी
ब्राउज़र फिंगरप्रिंट चेकर
ओपन ग्राफ मेटा टैग जनरेटर
OTP कोड जनरेटर
MIME प्रकार
JWT विश्लेषक
HTML WYSIWYG संपादक
User-agent parser
HTTP स्थिति कोड
JSON तुलना
छवियां और वीडियो
QR कोड जनरेटर
WiFi QR कोड जनरेटर
कैमरा रिकॉर्डर
विकास
Crontab जनरेटर
JSON सुंदरता और स्वरूपण
JSON संक्षिप्त करें
JSON से CSV
SQL सुंदरता और स्वरूपण
Chmod कैलकुलेटर
Docker Run से Docker Compose कन्वर्टर
XML स्वरूपक
YAML सुंदरता और स्वरूपण
Regex Tester
Regex cheatsheet
नेटवर्क
IPv4 सबनेट कैलकुलेटर
IPv4 पता परिवर्तक
IPv4 श्रेणी विस्तारक
MAC पता लुकअप
MAC पता जनरेटर
IPv6 ULA जनरेटर
गणित
गणित मूल्यांकनकर्ता
मापन
क्रोनोमीटर
तापमान कन्वर्टर
पाठ
पाठ सांख्यिकी
इमोजी चयनकर्ता
पाठ अंतर
ASCII Art Text Generator
© 2025 XFreeTool
हिन्दी
English
简体中文
Español
Français
Português
Deutsch
日本語
Norwegian
繁體中文
한국어
Русский
Tiếng Việt
Українська
हिन्दी
বাংলা
Bahasa Indonesia

Regex cheatsheet

Javascript Regex/Regular Expression cheatsheet

Normal characters

ExpressionDescription
. or [^\n\r]any character excluding a newline or carriage return
[A-Za-z]alphabet
[a-z]lowercase alphabet
[A-Z]uppercase alphabet
\d or [0-9]digit
\D or [^0-9]non-digit
_underscore
\w or [A-Za-z0-9_]alphabet, digit or underscore
\W or [^A-Za-z0-9_]inverse of \w
\Sinverse of \s

Whitespace characters

ExpressionDescription
space
\ttab
\nnewline
\rcarriage return
\sspace, tab, newline or carriage return

Character set

ExpressionDescription
[xyz]either x, y or z
[^xyz]neither x, y nor z
[1-3]either 1, 2 or 3
[^1-3]neither 1, 2 nor 3
  • Think of a character set as an OR operation on the single characters that are enclosed between the square brackets.
  • Use ^ after the opening [ to “negate” the character set.
  • Within a character set, . means a literal period.

Characters that require escaping

Outside a character set

ExpressionDescription
\.period
\^caret
\$dollar sign
|pipe
\\back slash
\/forward slash
\(opening bracket
\)closing bracket
\[opening square bracket
\]closing square bracket
\{opening curly bracket
\}closing curly bracket

Inside a character set

ExpressionDescription
\\back slash
\]closing square bracket
  • A ^ must be escaped only if it occurs immediately after the opening [ of the character set.
  • A - must be escaped only if it occurs between two alphabets or two digits.

Quantifiers

ExpressionDescription
{2}exactly 2
{2,}at least 2
{2,7}at least 2 but no more than 7
*0 or more
+1 or more
?exactly 0 or 1
  • The quantifier goes after the expression to be quantified.

Boundaries

ExpressionDescription
^start of string
$end of string
\bword boundary
  • How word boundary matching works:
    • At the beginning of the string if the first character is \w.
    • Between two adjacent characters within the string, if the first character is \w and the second character is \W.
    • At the end of the string if the last character is \w.

Matching

ExpressionDescription
foo|barmatch either foo or bar
foo(?=bar)match foo if it’s before bar
foo(?!bar)match foo if it’s not before bar
(?<=bar)foomatch foo if it’s after bar
(?<!bar)foomatch foo if it’s not after bar

Grouping and capturing

ExpressionDescription
(foo)capturing group; match and capture foo
(?:foo)non-capturing group; match foo but without capturing foo
(foo)bar\1\1 is a backreference to the 1st capturing group; match foobarfoo
  • Capturing groups are only relevant in the following methods:
    • string.match(regexp)
    • string.matchAll(regexp)
    • string.replace(regexp, callback)
  • \N is a backreference to the Nth capturing group. Capturing groups are numbered starting from 1.

References and tools

  • MDN
  • RegExplained