SonaeQube/SonarLint/SonarSource 中有一条反斜杠规则:-
"\" should only be used as an escape character outside of raw strings
[https://rules.sonarsource.com/python/RSPEC-1717][1]
所以现在我正在使用这样的正则表达式:-
re= '\{(\d+)[,\-](\d+)\}': # Numbered pattern
SonarQube 给出的问题是:删除这个“\”,添加另一个“\”来转义它,或者使它成为一个原始字符串。
我无法避免在这里使用反斜杠,请建议我如何解决这个问题。
九州编程
相关分类