i have a text editor all made and everything. but how do i make it so that when a user types the full complete word of my choice itll turn to a different color and bold or something like that. like any editor for html, javascript, C++ compilers, and everything.

like, while in the document, if someone types in the word
print
then i want it to go red and italic. but if they type in any other words, theyll still be blue.

oh yeah, and default text is blue and syntax words of my choice will appear red and some sort of text decoration.

how would i be able to do that.

it has to be more than a "for-each" loop.

if anyone needs more details then please, ask away:

but i think i got all the details down.