Sha256: ddfd9e2d4b5b814f4e7865de05eb857b3c86ba7297735dadc4261ed5a7065e50

Contents?: true

Size: 202 Bytes

Versions: 11

Compression:

Stored size: 202 Bytes

Contents

unless Regexp.method_defined? :match?
  class Regexp
    def match?(*args)
      # Fiber to avoid setting $~
      f = Fiber.new do
        !match(*args).nil?
      end
      f.resume
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
backports-3.11.3 lib/backports/2.4.0/regexp/match.rb
backports-3.11.2 lib/backports/2.4.0/regexp/match.rb
backports-3.11.1 lib/backports/2.4.0/regexp/match.rb
backports-3.11.0 lib/backports/2.4.0/regexp/match.rb
backports-3.10.3 lib/backports/2.4.0/regexp/match.rb
backports-3.10.2 lib/backports/2.4.0/regexp/match.rb
backports-3.10.1 lib/backports/2.4.0/regexp/match.rb
backports-3.10.0 lib/backports/2.4.0/regexp/match.rb
backports-3.9.1 lib/backports/2.4.0/regexp/match.rb
backports-3.9.0 lib/backports/2.4.0/regexp/match.rb
backports-3.8.0 lib/backports/2.4.0/regexp/match.rb