Problems with the regularization of python development

ss=re.findall (u"(d +) hours ago", s) "does the u here mean matching Chinese characters? Why do people say that if there are Chinese characters in it, u must be used?

can"t you match Chinese characters without u?

Mar.31,2021

A string that begins with u or U represents the unicode string


upstairs. You can take a look at this interesting article to deepen your understanding.
https://www.zhihu.com/questio.


u' indicates Unicode encoding, (d +) is the regular expression rule, and the matching content is


python2.
python3 does not need to add
py3 py2 encoding is very painful

.
Menu