Sublime Forum

Purple escaped characters after update?

#1

I use the Monokai color scheme and after the new big fancy update I have purple/pink highlights around my escape characters in my regexes. How do I turn this off?

0 Likes

#2

put ‘r’ before ", like this: search(r"Part Number…

0 Likes

#3

It looks like you’re writing Python code. The escapes in your code are incorrect; the syntax highlighter is marking them as deprecated. As ranklord says, the best way to write valid regexps is using raw literals:

r'Part Number\s*(.*)[\n$]'
1 Like

#4

Those were really fast replies! Thanks guys.

I guess I have some editing to do. I’ve always been a little confused on what the raw string did for me before reading this, one of those pitfalls of having a language be “helpful” I suppose. Now I don’t know what escape sequences python actually interprets beyond “\\” and probably need to read about that.

TL;DR: Thanks - since it always worked before I never had cause to change / examine it.

0 Likes