मुख्य सामग्री पर जाएँ
kitlocal.dev

Regex चीटशीट

लोकल चलता है

100% आपके ब्राउज़र में प्रोसेस होता है। इनपुट और आउटपुट कभी आपके डिवाइस से बाहर नहीं जाते।

इंटरैक्टिव लाइव मैचर लैब के साथ रेगुलर एक्सप्रेशन सिंटैक्स और पुन: उपयोग योग्य रेसिपी: एंकर, कैरेक्टर क्लास, क्वांटिफ़ायर, लुकअराउंड और फ़्लैग (ES2024)।

यह कैसे काम करता है

A regex engine scans left-to-right trying to satisfy your pattern at each position. Quantifiers (*, +, {n,m}) are greedy by default (consuming as much as possible before backtracking); append `?` to make them lazy, and anchor with `^`/`$` or `\b` when you need exact boundaries.

सर्वाइवल किट

वे कुछ कमांड जिन्हें सबसे पहले सीखना चाहिए।

41 कमांड

कीबोर्ड शॉर्टकट/खोज पर फ़ोकस करेंJKचयन आगे-पीछे करेंCचयनित कॉपी करेंFचयनित बुकमार्क करेंEscखोज साफ़ करें

Characters & character classes

Match single characters by category (`\d`, `\w`, `\s`) or explicit sets (`[a-f0-9]`). Uppercase shorthands invert the match.

आधिकारिक दस्तावेज़: Character classes
  • आवश्यक

    Match a digit, word character ([A-Za-z0-9_]) or whitespace.

    \d  \w  \s

    इसका उपयोग कब करें

    Core shorthand character classes used in almost every pattern.

    घटक विवरण

    \d
    ASCII digit [0-9] (uppercase \D = non-digit)
    \w
    alphanumeric + underscore (uppercase \W = non-word)
    \s
    space, tab or newline (uppercase \S = non-whitespace)

    उदाहरण

    Matches dates inside `"release 2026-11-15"`.

    \d{4}-\d{2}-\d{2}

    परिणाम

    ["2026-11-15"]

    यह भी देखें

Anchors & boundaries

Anchors match positions (start/end of string, line or word) rather than consuming characters.

आधिकारिक दस्तावेज़: Assertions

Quantifiers & laziness

Control how many times the preceding token repeats. Add `?` after any quantifier to match as few times as possible.

आधिकारिक दस्तावेज़: Quantifiers

Groups, alternation & backreferences

Parentheses group sub-expressions for quantifiers/alternation and capture text for extraction or backreferences.

आधिकारिक दस्तावेज़: Groups and backreferences

Lookaheads, lookbehinds & flags

Check what appears ahead or behind the current position without making it part of the matched text.

आधिकारिक दस्तावेज़: Assertions & flags

इसे KitLocal टूल में आज़माएँ

शब्दावली
Greedy vs Lazy
`.*` grabs to the last possible match; `.*?` stops at the earliest match.
Lookaround
Zero-width assertion (`(?=...)`, `(?!...)`, `(?<=...)`) that checks surrounding text without consuming characters.
Backtracking
When a quantifier gives up matched characters so later tokens can match; nested `*`/`+` can cause ReDoS.
Zero-width
Tokens like `^`, `$`, `\b` and lookarounds that match a position rather than characters.

15 नव॰ 2026 को जाँचा गया · वर्शन ES2024 RegExp के विरुद्ध जाँचा गया

स्रोत: MDN Regular Expressions Guide · MDN RegExp Reference

कोण कोष्ठक में दी गई किसी भी चीज़ को अपने मानों से बदलें। कमांड आधिकारिक दस्तावेज़ों से लिए गए हैं, और उदाहरण दिखाए गए वर्शन पर चलाए गए थे।