| π Symbol | π Description |
|---|---|
. |
Single character |
^ |
Start of a string |
$ |
End of a string |
[] |
One of the set of characters within [] |
[a-z] |
One of the range of characters |
[^abc] |
Not a, b or c |
[ab] |
a or b (a and b are strings) |
() |
Scoping for operators |
(?:<pattern>) |
Passive grouping (details) |
\ |
Escape character |
| π Symbol | π Description | π€― Equivalent |
|---|---|---|
\b |
Word boundary | |
\d |
Any digit | [0-9] |
\D |
Any non-digit | [^0-9] |
\s |
Any whitespace | [ \t\n\r\f\v] |
\S |
Any non-whitespace | [^ \t\n\r\f\v] |
\w |
Alphanumeric character | [a-zA-Z0-9_] |
\W |
Non-alphanumeric character | [^a-zA-Z0-9_] |
| π Symbol | π Description |
|---|---|
* |
Zero or more occurrences |
+ |
One or more occurrences |
? |
Zero or one occurrences |
{n} |
Exactly n repetitions |
{n,} |
At least n repetitions |
{,n} |
At most n repetitions |
{m,n} |
At least m and at most n repetitions |
| π§© Regex | π Description |
|---|---|
^.*SOME_STRING.*\n |
Finds all lines start with specific string |