Sha256: e0cc4f77b45622def53eaf0451da487ef0ad6c0f7ed6a49db7674f9c1b975f7f
Contents?: true
Size: 386 Bytes
Versions: 25
Compression:
Stored size: 386 Bytes
Contents
class String # Escape string for Regexp use. def regesc Regexp.escape( self ) end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCString < Test::Unit::TestCase def test_001 a = "?" b = /#{a.regesc}/ assert( b =~ "?" ) end end =end
Version data entries
25 entries across 25 versions & 1 rubygems