Regular expression in is a sequence of characters that forms a search pattern.
t is used to confirm whether the string has that particular term or not.
We can easily import regular expression in python.
syntax:-
import re
- [] – A set of characters
- \ – Signals a special sequence.
- . – Any character
- ^ – Starts with
- $ – Ends with
- * – Zero or more occurrence
- + – One or more occurrence
- {} – Exactly the specified number of occurrences.
- | – Either or
- () – Capture and group
This is all about regular expression in python.