make path matching more resiliant and parse file:///