Python RegEx Meta Characters
Metacharacters
Metacharacters are characters with a special meaning:
Character | Description | Example | Try it |
---|---|---|---|
[] | A set of characters | "[a-m]" | Try it » |
\ | Signals a special sequence (can also be used to escape special characters) | "\d" | Try it » |
. | Any character (except newline character) | "he..o" | Try it » |
^ | Starts with | "^hello" | Try it » |
$ | Ends with | "world$" | Try it » |
* | Zero or more occurrences | "aix*" | Try it » |
+ | One or more occurrences | "aix+" | Try it » |
{} | Exactly the specified number of occurrences | "al{2}" | Try it » |
| | Either or | "falls|stays" | Try it » |
() | Capture and group |