use regex to test path