Modification to speed up regexp matching for path matching code