+ 3
Purpose of re module
What is the purpose or application of re module?
6 ответов
+ 9
Basically, data mining.
Parsing strings and picking valuable organized data, meeting certain logical crteria, from sets of characters :)
But there are also other non-obvious applications, like checking if a number is prime:
https://code.sololearn.com/cgEoWC8lFuCk/#py
+ 10
Here's an example of a few uses:
https://code.sololearn.com/c40z8B7tOdCN/?ref=app
Constructing a proper regex may require some practice. There's a cool interactive site for testing your queries on your text samples:
www.regex101.com
+ 8
re module is used in regular expressions.
By importing re module regular expressions can be used.
+ 8
https://docs.python.org/2/library/re.html
+ 5
Can you show me an example to understand the purpose of it.