Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
First, \something is a way of specifying a character in a string.
In regular expressions, this syntax has its own meaning.
As a consequence of this conflict, one of two things must be done.
re.search("\\d[0-9A-Za-z]{1,5}", data) #удваиваем \
re.search(r"\d[0-9A-Za-z]{1,5}", data) #используем r-строку, чтобы отключить обычную обработку \
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question