Open zormit opened 2 years ago
👋 @zormit thanks for reaching out, I'm marking this for the next major version of the SDK so that it stays on our radar, but if it's a fix that doesn't break compatibility with python 3.5, we'll do our best to get it in the current major version of the SDK (v4).
The solution you proposed would mean, both the following strings are stored identically in memory with no concept of whether they were raw or not, for example:
r'a regex digit: \d' # a regex digit: \d
'a regex digit: \\d' # a regex digit: \d
Both these strings contain \d
and there is nothing to say that this came from a raw string. So when you pass this string to the re module it sees that there is a \d
and sees it as a digit because the re module does not know that the string came from a raw string literal.
There is a use-case to proceed with caution and I agree with @hollabaq86.
for internal tracking, ticket 2054
General information
Issue description
According to https://docs.python.org/3/library/re.html, some of the regex strings might lead to syntax errors in future python versions:
For example:
I think the solution is just to convert all regex strings to the raw
r"..."
format. But I'm not sure on backwards compatibility on that...