有人可以帮助我如何替换python 3中的#(\ w +)以使其正常工作吗?或如何使用我的代码解决此问题:
def find_hashtags(self, message):
return re.findall("#(\w+) ", message)
我很担心:
=============================== warnings summary ===============================
twitter.py:17
/root/PycharmProjects/learning_pytest/twitter.py:17: DeprecationWarning: invalid escape sequence \w
return re.findall("#(\w+) ", message)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
===================== 3 passed, 1 warnings in 0.01 seconds =====================
我检查了一些论坛,但不知道如何解决或替换此顺序