I'll try to rephrase the comment, to make it clearer.
Obviously your suggestion is spot on! I've be meaning to brush up on regular expressions, this might be a good time to do that.