सभी tools
निःशुल्क

खोजने और प्रिंट करने योग्य Regex संदर्भ — कैरेक्टर क्लास, एंकर, क्वांटिफायर, ग्रुप, लुकअराउंड, फ्लैग और तैयार पैटर्न। निःशुल्क।

Character classes

12
\d
Any digit, equivalent to [0-9]
\D
Any non-digit character
\w
Word character: letter, digit or underscore
\W
Any non-word character
\s
Any whitespace (space, tab, newline)
\S
Any non-whitespace character
.
Any character except newline
[abc]
Any one of a, b or c
[^abc]
Any character except a, b or c
[a-z]
Any lowercase letter in the range
[A-Za-z0-9]
Any alphanumeric character
[\d\s]
Combine classes inside brackets

Anchors & boundaries

8
^
Start of string (or line in multiline mode)
$
End of string (or line in multiline mode)
\b
Word boundary between \w and \W
\B
Not a word boundary
\A
Start of the entire string (PCRE)
\z
End of the entire string (PCRE)
\Z
End of string, before a trailing newline (PCRE)
\G
Start of the current match attempt (PCRE)

Quantifiers

11
*
Zero or more of the preceding token
+
One or more of the preceding token
?
Zero or one (makes it optional)
{n}
Exactly n repetitions
{n,}
n or more repetitions
{n,m}
Between n and m repetitions
*?
Lazy: zero or more, as few as possible
+?
Lazy: one or more, as few as possible
??
Lazy: optional, prefers zero
{2,5}?
Lazy bounded repetition
a++
Possessive: no backtracking (PCRE)

Groups & backreferences

9
(abc)
Capturing group, stores the match
(?:abc)
Non-capturing group
(?<name>abc)
Named capturing group
(?P<name>abc)
Named group, alternate PCRE syntax
a|b
Alternation: match a or b
(red|blue)
Grouped alternation
\1
Backreference to capturing group 1
\k<name>
Backreference to a named group
$1
Reference group 1 in a replacement

Lookaround

6
(?=abc)
Positive lookahead: followed by abc
(?!abc)
Negative lookahead: not followed by abc
(?<=abc)
Positive lookbehind: preceded by abc
(?<!abc)
Negative lookbehind: not preceded by abc
\d(?=px)
Digit only if followed by px
(?<=\$)\d+
Digits only if preceded by a dollar sign

Flags & modifiers

10
g
Global: find all matches, not just the first
i
Case-insensitive matching
m
Multiline: ^ and $ match line breaks
s
Dotall: . also matches newline
u
Unicode mode (full code points)
x
Extended: ignore whitespace, allow comments
y
Sticky: match from lastIndex (JS)
(?i)
Inline case-insensitive flag (PCRE)
(?im)
Combine inline flags
(?i:abc)
Scoped inline flag for a group

Escapes & special chars

11
\.
Literal dot
\\
Literal backslash
\/
Literal forward slash (in /.../ literals)
\t
Tab character
\n
Newline (line feed)
\r
Carriage return
\f
Form feed
\0
Null character
\xFF
Character by two-digit hex code
\x{00E9}
Unicode code point by hex (PCRE)
\Qabc\E
Quote a literal block (PCRE)

Common token shortcuts

10
[0-9]
Single digit, same as \d
[a-fA-F0-9]
A single hexadecimal digit
\d+
One or more digits (whole number)
\w+
One or more word characters
\s+
One or more whitespace characters
.*
Any run of characters (greedy)
.*?
Any run of characters (lazy)
[^\s]+
One or more non-whitespace characters
\b\w+\b
A whole word
(?:\r\n|\n|\r)
Any line ending

Practical patterns

10
^[\w.+-]+@[\w-]+\.[\w.-]+$
Simple email address
https?:\/\/[^\s]+
HTTP or HTTPS URL
\b(?:\d{1,3}\.){3}\d{1,3}\b
IPv4 address
#?[a-fA-F0-9]{6}\b
Six-digit hex color
\d{4}-\d{2}-\d{2}
Date in YYYY-MM-DD format
\+?\d[\d\s-]{7,}\d
Phone number (loose)
[a-z0-9]+(?:-[a-z0-9]+)*
URL slug (lowercase, hyphens)
^\s+|\s+$
Leading or trailing whitespace (trim)
\s{2,}
Two or more consecutive spaces
<[^>]+>
An HTML tag (naive)

Unicode properties

10
\p{L}
Any kind of letter from any language
\P{L}
Any character that is not a letter
\p{N}
Any kind of numeric character
\p{Lu}
An uppercase letter
\p{Ll}
A lowercase letter
\p{P}
Any punctuation character
\p{Sc}
A currency symbol
\p{Han}
A Han (Chinese) script character
\p{Emoji}
An emoji character (where supported)
\p{Greek}
A character from the Greek script

कोई प्रविष्टि “:q” से मेल नहीं खाती।


Regex चीट शीट के बारे में

यह regex चीट शीट रेगुलर एक्सप्रेशन सिंटैक्स का एक संक्षिप्त रेफरेंस है: कैरेक्टर क्लास, एंकर और बाउंडरी, क्वांटिफायर, ग्रुप और बैकरेफरेंस, लुकअराउंड, फ्लैग और मॉडिफायर, एस्केप और स्पेशल कैरेक्टर, आम टोकन शॉर्टकट्स, प्रैक्टिकल तैयार पैटर्न, और यूनिकोड प्रॉपर्टीज़।

Regex "एक बार लिखो, फिर भूल जाओ" सिंटैक्स की परिभाषा है — टोकन संक्षिप्त और भ्रमित करने वाले होते हैं, खासकर लुकअहेड बनाम लुकबिहाइंड, ग्रीडी बनाम लेज़ी क्वांटिफायर, और विभिन्न ग्रुप फॉर्म। हर रो एक टोकन या पैटर्न को सादे-अंग्रेज़ी विवरण के साथ दिखाती है कि वह क्या मैच करता है।

यह शीट प्रैक्टिकल पैटर्न के साथ समाप्त होती है जिन्हें आप सीधे कॉपी कर सकते हैं, और यहां के हर चीट शीट की तरह यह फ्री और क्लाइंट-साइड है: लाइव सर्च, स्टिकी टेबल ऑफ कंटेंट्स, हर टोकन पर वन-क्लिक कॉपी और पेपर regex रेफरेंस के लिए प्रिंट बटन।

Regex चीट शीट का उपयोग कैसे करें

  1. सेक्शन देखें, Character classes और Anchors & boundaries से लेकर Practical patterns और Unicode properties तक।
  2. lookahead, \d या lazy जैसा कोई टोकन या कॉन्सेप्ट सर्च करें ताकि शीट तुरंत फिल्टर हो जाए।
  3. जब आपको तैयार एक्सप्रेशन एडजस्ट करना हो तो Practical patterns पर जंप करें।
  4. किसी टोकन या पैटर्न, या उसके कॉपी आइकन पर क्लिक करें ताकि उसे अपने कोड या regex टेस्टर में कॉपी कर सकें।
  5. शीट प्रिंट करें — regex सिंटैक्स को कागज़ पर रखना एक क्लासिक बात है।

अक्सर पूछे जाने वाले प्रश्न

दस सेक्शन: कैरेक्टर क्लास, एंकर और बाउंडरी, क्वांटिफायर, ग्रुप और बैकरेफरेंस, लुकअराउंड, फ्लैग और मॉडिफायर, एस्केप और स्पेशल कैरेक्टर, टोकन शॉर्टकट्स, प्रैक्टिकल पैटर्न, और यूनिकोड प्रॉपर्टीज़।

हां। practical-patterns सेक्शन में आम मैचिंग कार्यों के लिए पूरे एक्सप्रेशन हैं जिन्हें आप टोकन-दर-टोकन बनाने के बजाय कॉपी करके एडजस्ट कर सकते हैं।

हां। लुकअराउंड सेक्शन पॉज़िटिव और नेगेटिव लुकअहेड व लुकबिहाइंड को विवरण के साथ साथ-साथ लिस्ट करता है — regex सिंटैक्स के सबसे भ्रमित करने वाले कोनों में से एक।

दिखाया गया सिंटैक्स मुख्यधारा के इंजनों में व्यापक रूप से साझा किया जाने वाला कोर है, जिसमें कैरेक्टर क्लास, क्वांटिफायर, ग्रुप, लुकअराउंड, फ्लैग और यूनिकोड प्रॉपर्टी एस्केप शामिल हैं। इंजन-विशिष्ट एक्सटेंशन अलग-अलग होते हैं, इसलिए असामान्य कंस्ट्रक्ट्स को अपनी टारगेट भाषा में टेस्ट करें।

हां, पूरी तरह मुफ्त — सर्च करने योग्य, प्रिंट करने योग्य और पूरी तरह आपके ब्राउज़र में रेंडर होने वाला।

इसे साझा करें

लोकप्रिय खोजें
regex cheat sheet regular expression syntax regex character classes regex lookahead and lookbehind regex quantifiers list regex flags reference common regex patterns regex email pattern
मदद चाहिए?
इस टूल में कोई समस्या मिली? हमारी टीम को बताएं।
समस्या की रिपोर्ट करें

इस मुफ़्त टूल को अपनी वेबसाइट पर जोड़ें — नीचे दिया गया कोड कॉपी और पेस्ट करें।