2014-11-15から1日間の記事一覧
概要 Regexp#escape(string) -> String Regexp#quote(string) -> String 詳細 正規表現の利用時にエスケープが必要な文字にバックスラッシュを付与する。 サンプルコード puts Regexp.escape('.*?/+-{}()abc') puts Regexp.quote('.*?/+-{}()abc') 出力 \.\*…
概要 Regexp#escape(string) -> String Regexp#quote(string) -> String 詳細 正規表現の利用時にエスケープが必要な文字にバックスラッシュを付与する。 サンプルコード puts Regexp.escape('.*?/+-{}()abc') puts Regexp.quote('.*?/+-{}()abc') 出力 \.\*…