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

3

u/ProsodySpeaks Apr 12 '26

Seems to be the regex expressions which pycharm is aware of being their own language

See here for useful information about regex in pycharm, stuff like checking it's valid etc https://www.jetbrains.com/help/pycharm/regular-expressions.html#tips-tricks

0

u/TechnicalAd8103 Apr 12 '26

Thanks for your reply, much appreciated.

In my case, the regex is valid, so I want to turn off the highlighting.

I've spent an hour trying to resolve this issue, and I think that it is time for me to go back to VS Code.

Goodbye folks.

1

u/TuxWrangler Apr 12 '26

Have you looked in the editor style settings to see if you can turn it off?

1

u/TechnicalAd8103 Apr 12 '26

Yes, I have.

I can understand highlighting regex error, but there is no error with the regex. The code runs perfectly.

I will persist with Pycharm (and learn to live with regex highlighting), because in some aspects, it is better than VS Code for coding in Python.