I want to lean how to highlight syntax of various programming and markup languages. I admit that I have no prior knowledge of this so this might as well be off-topic.
Say, for example, I want to highlight HTML
tags. What I think can be done is to use RegEx
to find tags.
You can find tags using RegEx
and then get their start and end position. Then, you can change the color of that particular text.
However, the above approach will not work if the tags had attributes with them. <img src="...">
So, can someone please guide me as how how this can be achieved.
A third-party API is fine but I would like to learn how this can be done :)