bold _italics
Character | Example | Definition |
---|---|---|
* | ab | Matches the previous character 0 or more times |
+ | a+b+ | Matches the previous character 1 or more times |
[ ] | [a-z] | Matches any character from a to z |
[^ ]] | [a-z] | Does not matches any character from a to z |
() | (ab) | A grouped subexpression, this are executed first |
| | (foo | foot)s |
{m,n} | a{2,3} | Matches the preceding character, m to n |
. | b.d | Matches any charater |
^ | ^a | Indicates an expression at the begining of the sting |
\ | ^ |\ | An escape charater |
$ | [A-Z]*$ | Often at the of the expression it matches the end of the string |
?! | ^((?![A-Z]).)*$ | Does seomthing?? expand |
? | (swimming )? pool | makes the previous expression optional |
?? | (swimming )? pool | lazy |
(?=) | A(?=B) | look ahead Matches an A followed by a B: AB, ABC, |
(?!) | A(?!B) | look ahead negaticefind a expression A where B *does not * follows |
(?<=) | (?<=B)A | look behind Find Expresion A where B preceds it |
(?<!) | (?<!B)A | look behind negatice find expression A where expression B does not precced |
(?>) | (?>foo | foot)s |