DevToys Web Pro iconDevToys Web Proబ్లాగ్
మాకు రేటింగ్ ఇవ్వండి:
బ్రౌజర్ ఎక్స్‌టెన్షన్‌ను ప్రయత్నించండి:

Regex చీట్‌షీట్

Character classes

సింటాక్స్వివరణఉదాహరణకాపీ
.Any character except newlinea.c → abc, a-c
[abc]Match a, b, or c[xyz] → x, y, z
[^abc]Match anything except a, b, c
[a-z]Character range (a to z)
\dDigit (0-9)\d{3} → 123
\DNon-digit
\wWord character [a-zA-Z0-9_]
\WNon-word character
\sWhitespace
\SNon-whitespace

Anchors

సింటాక్స్వివరణఉదాహరణకాపీ
^Start of string/line^Hello
$End of string/lineWorld$
\bWord boundary\bword\b
\BNon-word boundary

Escaped characters

సింటాక్స్వివరణఉదాహరణకాపీ
\tTab
\nNewline
\rCarriage return
\0Null character
\xhhHex character (e.g. \xFF)
\uhhhhUnicode character

Groups & References

సింటాక్స్వివరణఉదాహరణకాపీ
(abc)Capturing group
(?:abc)Non-capturing group
(?<name>abc)Named capturing group
\1Back-reference to group 1
\k<name>Back-reference to named group

Lookaround

సింటాక్స్వివరణఉదాహరణకాపీ
(?=abc)Positive lookaheadfoo(?=bar) matches foo in foobar
(?!abc)Negative lookahead
(?<=abc)Positive lookbehind
(?<!abc)Negative lookbehind

Quantifiers & Alternation

సింటాక్స్వివరణఉదాహరణకాపీ
a*0 or more (greedy)
a+1 or more (greedy)
a?0 or 1 (optional)
a{n}Exactly n times
a{n,}n or more times
a{n,m}Between n and m times
a*?0 or more (lazy)
a+?1 or more (lazy)
a|bMatch a or b

Substitution

సింటాక్స్వివరణఉదాహరణకాపీ
$1, $2Captured group content
$&Entire match
$`Before match
$'After match
$$Literal $ character

Flags

సింటాక్స్వివరణఉదాహరణకాపీ
gGlobal — match all occurrences
iCase-insensitive
mMultiline — ^ and $ match line breaks
sDotall — . matches newlines too
uUnicode — full Unicode support
ySticky — match at lastIndex only