How to change the color of PART of a text mesh?

Hello, I am using Unity 2D to create a simple typing game - the enemies names are above their heads, and you type their name to defeat them. I want to highlight the letters as you type them. For example, if an enemy’s name is Barnabus, and the player types B-A-R, I want the first three letters to be red, while the rest of the name stays white.

I am using a Text Mesh to display the name above the character’s head, and I know that TextMesh.color can be used to change the color of the entire Text Mesh, but I can’t figure out any way to only change part of the mesh.

If this is impossible, I guess I would have to have a separate Mesh for each letter, which seems like a nightmare. If anyone has any ideas on how to do that, that would also be appreciated.