Imrproved speed of parsing selector by using regex + .test() instead of indexOf