In your example you used a single character as the keyword. I will presume that's always what you want. If that's not what you wanted, this solution would have to be modified. Here's how I would do it, in a single action:
There's definitely a chance that I misinterpreted what you wanted. But if I did, I can probably modify this example to make it work for you.
Of course you can use a variable in place of the Text in my example. I just thought it was easier to illustrate this way.