How In-game script (code) editor widget?

Wanna create in-game terminal so need to implement syntax highlighting somehow. The first idea was to create widget with rich text and use <> to highlight keywords, need to extract the text, then use some functions to proceed it and put tags in right places.
So stacked with the problem how to actually do this. In short, need to create MultiLineEditableTextBox which will contain field of rich text.