properly decode path names
escape regex because path names can contain regex pattern characters
WS only
removes crap
WS only
WS only
properly encode path names