Dracunos
Dracunos

Reputation: 79

Highlighting regex capture groups in notepad++?

As of now if I do a regex 'find and replace' in notepad++ it highlights the entire search parameter like a normal text 'find'.

Would it be possible to have it highlight capture groups in a different color so I can easily identify what I'm capturing in regex?

For example, if I wanted to match: print 'foo.' But capture foo for a replace string, with ^print '(\w+).'$ It would highlight the entire line in grey.

I'd like it to highlight it all in grey, but highlight foo in red, for example, to designate that was captured rather than replacing and undo-ing if I happened to capture the wrong thing. Each capture group highlighted in a different color, maybe blend the colors if you captured something in multiple groups, obv would only help for simpler captures. Would that be possible in npp?

Upvotes: 1

Views: 1371

Answers (1)

streetturtle
streetturtle

Reputation: 5850

For the moment there is no such plugin, but I would try for testing this site: https://regex101.com/ which shows a lot of information about matches.

Or install RegexBuddy http://www.regexbuddy.com/demotest.html. So that you can do a simple test there and then switch to NotePad++.

Upvotes: 0

Related Questions