Also, is there a reason why you couldn't use if_match for this?  Regexes should have covered all your needs here, and we all speak regex here.