Sublime Forum

Highlight bug in python

#1

I was write a code in python, I ran into this highlight bug:


Could write that part of the code this way: '\\1****', then highlight works as expected.
Is there a way to fix this?

os: macos,
sublimetext version: Build 4200

0 Likes

#2

From my understanding, when you use an r-string, the content is evaluated as a regular expression pattern, not a substitution pattern. Multiple * is invalid. Using the r-string as a substitution pattern is something many people do as well. Should the highligher be relaxed for such things :man_shrugging:. You can use a capital R-string (R'\1****'), which will treat the expression normally, allowing you to still not need to escape your backslash.

1 Like

#3

Bro, thank you.

0 Likes