in reply to Perl alternation regex looks ok to me?
You've been given good solutions already, but, just to explain further, note that alternatives have a very low precedence in regexes, so that, for example, /blue|green/ is understood as an alternative between the two colors (either blue or green), and not as something like /blu(e|g)reen/ (i.e. either bluereen or blugreen).