I'm in search of a tool which will allow me to customize dynamic syntax highlight rules :

Examples of static syntax highlighting (most IDEs already do this).

  1. Highlight all occurences of the word int as red.

  2. Highlight all strings (enclosed in ") in blue.

Examples of DYNAMIC syntax highlighting

  1. Given a string of txt that appears > twice, I want it highlighted purple.

  2. If I click on a block of text, I would like all blocks of txt on the same file highlighted green.

I'm assuming that someone may have built such a highlighter before, but I can't find anything on the web. Any feedback on how:

  1. I can extend an existing project (ideally, I'd like this to be an IDE plugin) to customize my dynamic requirements?

  2. In case 1 is not in existence, any templating languages that might be maximally effective for this sort of project ? i.e. any frameworks that highlight text on the fly, dynamically, while enabling editing - that are easily extended.

Edit
Report