Riot Games interview question

How would you have solved this with Regular Expressions?