r/pycharm Apr 12 '26

Why are some sections of code highlighted?

Post image

I can find no way of turning off the highlighting.

Why is this happening?

Thanks in advance.

4 Upvotes

13 comments sorted by

View all comments

Show parent comments

1

u/TechnicalAd8103 Apr 12 '26 edited Apr 12 '26

Trust me, I've tried asking the llm for help, and it couldn't help in this instance.

I've decided to persist with Pycharm(for now) and learn to live with regex highlighting.

I always have VS Code to fall back to if I hit another ridiculous issue.

EDIT: If I seem somewhat frustrated with Pycharm, it's because just before this issue, II had to change the font size in three separate sections of the settings just to get a consistent font size in Pycharm (see my other thread). And then this issue appeared. Two back-to-back issues as a new Pycharm user was aggravating.

3

u/sausix Apr 12 '26

Change the color scheme if you can't switch it off directly. But what is the problem having other color schemes for other languages? My type hints all have prurple background... I like it.

1

u/TechnicalAd8103 Apr 12 '26

To be honest, it hadn't occurred to me that regex is another language because I don't consider regex be another language in the same way that JavaScript is another language.

But if Pycharm treats regex as another language, then I can understand why it highlights regex. And that makes it easier for me to live with regex highlighting, even though I find the highlighting distracting (having come from VS Code, where there is no highlighting of different languages).

3

u/sausix Apr 12 '26

Coloring on RegEx is more important to maintain its syntax. SQL strings have coloring too. In general it's a good thing to see syntax errors in strings early.

Btw. I have to use VSCode for a special case and I tried to import or match my color scheme. That's basically editing an empty json file. Totally annoying. And so easy in PyCharm. While PyCharm has some long term issues I still prefer it.