0
Is re module of any use in Python ?
If I want to match some character I can use the following code. if 'abc' in 'abcd': print('M') else: print('N') So why to use re module.Moreover re module seems to be complicated cause I am beginner 😕
2 ответов
+ 3
Ahh, but what if you want to check if "a" followed by any other letter followed by "c" is in a much longer string? Then that becomes much more complicated to code without using regex - that's where it comes into its own.
Yes, regex is complicated and it looks completely alien to the beginner but think about it, if there wasn't any use for it, why would someone have created it?