trying to convert paths into regexs