perf(Selector): Optimize regexp matching