adding option to use \W for path instead of \w