+ 4
What is the function of re module?
2 odpowiedzi
+ 1
re stands for Regular Expressions. It makes recognizing patterns much easier. Check out this documentation page for more information and done examples. https://docs.python.org/3/library/re.html
0
regular expression module, used for pattern matching and perform some specific operations on occurrence of specific patterns. Regular expressions have some specifc syntax.
Take an example of IP address validation.
generally we process it like,
1. split given string in 4 parts.
2. convert string to integers
3. validate if it is less then 256 and no leading zeros there after each dot.
But using regular expression it is a single step process.