Use Regexp.escape instead of re-implementing it