Though not a terrible idea, using regex here is unnecessary. A simple change to the indexOf call will work. 

Fun reading: http://blog.codinghorror.com/regular-expressions-now-you-have-two-problems/