updated path regex to include ~