Elements in Regular Expressions
| Expression | Description and Matching Examples |
| . | Any single character. |
| [abc] | Any single character enclosed in the brackets. |
| [^abc] | Any single character not enclosed in the brackets. |
| [a-z] | Any single character ranging from a thru z. |
| [0-9] | Any single digit. |
| (susan|mary) | susan or mary. |
| a? | Zero or one occurence of a. |
| a* | Zero or more occurence of a. |
| a+ | One or more occurence of a. |
| ^abc | A line led by abc. |
| abc$ | A line terminated by abc. |
Frequent-used Regexes
Email address: ^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$
Float number: ^[+-]?\d+(\.\d*([Ee][+-]?\d+)?)?$
C++ identifier: ^[A-Za-z_][A-Za-z0-9_]*$
URL: ^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$