added escaping of forward slashes in pattern (closes #42). fixed hanging replace (closes #41).