On second thought, scratch the double bonus points for using regex-- I don't think the performance and maintainability tradeoff would be worth it for something there isn't a clear use case for. This is good just the way it is.