in reply to Finding out which of a list of patterns matched
Thanks to everyone that replied. Your help has been invaluable and I've learnt quite a bit from reading these answers. :)
I think I'll go with nobull's method as it seems to be the simplest to do what I want.