modify pathtoregexp to add slash