Escape path-rewrite string for pattern usage

There should be more escaping.
Fix critical bug which drops some characters

See bug #25 on github
Merge branch 'hotfix_v1.6' into develop_v1.7

* hotfix_v1.6:
  Fix critical bug which drops some characters

See bug #25 on github
Merge branch 'develop_v1.7' into develop