| Math | Pattern | Pattern meaning |
|---|---|---|
| no equivalent | ||
| no character at all | matches "" |
|
c |
c |
matches "c" |
| p1p2 | matches p1 then p2 | |
p1|p2 |
matches p1 or p2 | |
p* |
matches "" or p repeated |
|
p+ |
matches p repeated, but not "" |
|
p? |
matches p or "" |
|
p{n} |
matches p repeated n times | |
p{n,m} |
matches p repeated n to m times | |
. |
matches any character | |
[c1...cn] |
matches $c_1$ or $c_2$ or … or $c_n$ | |
[^c1...cn] |
matches any char but $c_1$ or … or $c_n$ |
|
| $(L)$ | (p) |
matches p, remembers submatch |
| no equivalent | \n |
matches string from nth submatch |
| no equivalent | \b |
matches a word boundary |
| no equivalent | \w |
matches a word character, e.g., alphanumeric |
| no equivalent | \W |
matches a nonword character, e.g., punctuation |
| no equivalent | \s |
matches a whitespace character, e.g., space, tab, return |
| no equivalent | \S |
matches a non-whitespace character, e.g., alphanumeric, punctuation |
| no equivalent | \d |
matches a digit character, i.e., 0-9 |
| no equivalent | \D |
matches a non-digit character, e.g., alphanumeric, punctuation |
| no equivalent | ^ |
matches start of line/string |
| no equivalent | $ |
matches end of line/string |
| no equivalent | [c1-c2] |
matches $c_1$ through $c_2$ |
Interesante la tabla que nos trae este artículo sobre el entendimiento de regex (ingles).