Another option would be to construct a regexp that matched all these cases, instead of having a list of regexps.