SunnyD: I did use regex...
And WorldDMT, that does not work. The help file explains better than me as to why:
This creates the local variable %x in the current routine and can only be referenced from inside this routine.