Support selectors on regexp rules

Also, don't convert to a string unless it's necessary.