method

quote

v1_8_6_287 - Show latest stable - Class: Regexp
quote(...)
public

Escapes any characters that would have special meaning in a regular expression. Returns a new escaped string, or self if no characters are escaped. For any string, Regexp.escape(str)=~str will be true.

   Regexp.escape('\\*?{}.')   #=> \\\\\*\?\{\}\.