Issue
re.compile('\s+', flags = re.UNICODE)
The above code gives the following warning in python3.
SyntaxWarning: invalid escape sequence \s
I fix it by using r'\s+'
. Is it a correct way to fix the problem?
Solution
Yes, that is. You can either use a raw string r'\s+'
or alternatively escape the backslash with '\\s+'
.
Answered By - ruohola
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.