0
pattern = r"(.+) \1"
What exactly it do?
3 ответов
+ 4
its a regular expression where .+ means one or many dots
and \1 means match the exact same text that was matched by 1st group.
group means written content written in parenthesis( ).
+ 3
'.+' in regexp means one or many characters ( the dot is the wildcard ).
To match a dot, you need to escape it '\.' or to use it in a class of char: '[.]'...
0
Thanks