escape(p1)
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.new(Regexp.escape(str))=~str will be true.
Regexp.escape('\*?{}.')
Show source
static VALUE
rb_reg_s_quote(VALUE c, VALUE str)
{
return rb_reg_quote(reg_operand(str, TRUE));
}