improved path detection regex
1.0.2