abc | Matches exact string "abc" |
. | Any single character (except newline) |
\d | Any digit [0-9] |
\D | Any non-digit |
\w | Word character [a-zA-Z0-9_] |
\W | Non-word character |
\s | Whitespace (space, tab, newline) |
\S | Non-whitespace |
\n | Newline |
\t | Tab |
\r | Carriage return |
\. | Literal dot |
\* | Literal asterisk |
\+ | Literal plus |
\? | Literal question mark |
\[ | Literal bracket |
\( | Literal parenthesis |
\{ | Literal brace |
\\ | Literal backslash |
\^ | Literal caret |
\$ | Literal dollar sign |
\| | Literal pipe |
^ | Start of string/line |
$ | End of string/line |
\b | Word boundary |
\B | Non-word boundary |
\A | Start of string (absolute) |
\Z | End of string (absolute) |
\z | Very end of string |
^Hello | Line starting with "Hello" |
world$ | Line ending with "world" |
^Hello$ | Line containing only "Hello" |
\bword\b | Whole word "word" |
\Bword | "word" not at word start |
* | 0 or more (greedy) |
+ | 1 or more (greedy) |
? | 0 or 1 (optional) |
{n} | Exactly n times |
{n,} | n or more times |
{n,m} | Between n and m times |
*? | 0 or more (lazy) |
+? | 1 or more (lazy) |
?? | 0 or 1 (lazy) |
{n,}? | n or more (lazy) |
{n,m}? | Between n and m (lazy) |
colou?r | Matches "color" or "colour" |
\d{3}-\d{4} | Phone: 123-4567 |
\d{2,4} | 2 to 4 digits |
<.*> | Greedy: matches longest |
<.*?> | Lazy: matches shortest |
(abc) | Capturing group |
(?:abc) | Non-capturing group |
(?<name>abc) | Named capturing group |
(?P<name>abc) | Named group (Python) |
\1 | Backreference to group 1 |
\k<name> | Backreference to named group |
(?>abc) | Atomic group (no backtrack) |
a|b | Match "a" or "b" |
(cat|dog) | Match "cat" or "dog" |
gr(a|e)y | Match "gray" or "grey" |
(\d{3})-(\d{4}) | Capture area code and number |
(\w+)\s+\1 | Match repeated word |
(?<year>\d{4})-(?<month>\d{2}) | Named groups for date |
^(https?|ftp):// | Match http, https, or ftp |
[abc] | Match a, b, or c |
[^abc] | Not a, b, or c |
[a-z] | Lowercase letter |
[A-Z] | Uppercase letter |
[0-9] | Digit |
[a-zA-Z] | Any letter |
[a-zA-Z0-9] | Alphanumeric |
[\s\S] | Any character including newline |
[:alpha:] | Alphabetic characters |
[:digit:] | Digits |
[:alnum:] | Alphanumeric |
[:space:] | Whitespace |
[:upper:] | Uppercase |
[:lower:] | Lowercase |
[:punct:] | Punctuation |
[:xdigit:] | Hexadecimal digits |
(?=abc) | Positive lookahead |
(?!abc) | Negative lookahead |
(?<=abc) | Positive lookbehind |
(?<!abc) | Negative lookbehind |
\d+(?=px) | Digits followed by "px" |
\d+(?!px) | Digits not followed by "px" |
(?<=\$)\d+ | Digits after "$" |
(?<!\$)\d+ | Digits not after "$" |
(?<=<b>).*(?=</b>) | Content between <b> tags |
\b\w+(?=ing\b) | Word before "ing" |
i | Case insensitive |
g | Global (find all matches) |
m | Multiline (^ and $ match lines) |
s | Dotall (. matches newline) |
x | Extended (ignore whitespace) |
u | Unicode support |
/hello/i | Match "Hello", "HELLO", etc. |
/pattern/g | Find all occurrences |
/^line/m | Match "line" at start of any line |
/a.b/s | Match "a\nb" (dot matches newline) |
(?i)hello | Inline case insensitive |
^[\w.-]+@[\w.-]+\.\w{2,}$ | Email address |
^https?://[\w.-]+(?:/[\w./-]*)?$ | URL |
^\d{3}-\d{3,4}-\d{4}$ | Phone number (KR) |
^\d{4}-\d{2}-\d{2}$ | Date (YYYY-MM-DD) |
^(?=.*[A-Z])(?=.*[a-z])(?=.*\d).{8,}$ | Strong password |
^\d{1,3}(\.\d{1,3}){3}$ | IPv4 address (simple) |
^#?([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$ | Hex color code |
^[a-z0-9_-]{3,16}$ | Username |
<[^>]+> | HTML tags |
\b\d{1,3}(\.\d{3})*(,\d+)?\b | Numbers with separators |
["'](.*?)["'] | Quoted strings |
\([^)]+\) | Content in parentheses |
/\*[\s\S]*?\*/ | C-style comments |
//.*$ | Single line comment |