Sha256: 0daa3b75c99aadde26942226a8e680e8375a8fa82771e48c45001210c1663390

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

# A `Regexp` holds a regular expression, that can be used to match
# against strings. Regexps may be created as literals, or using the
# {Regexp.new} method:
#
#     /abc/                 # => /abc/
#     Regexp.new '[a-z]'    # => /[a-z]/
#
# Implementation details
# ----------------------
#
# Instances of {Regexp} are toll-free bridged to native javascript
# regular expressions. This means that javascript regexp instances may
# be passed directly into ruby methods that expect a regexp instance.
#
# Due to the limitations of some browser engines, regexps from ruby are
# not always compatible with the target browser javascript engine.
# Compatibility differences change between engines, so reading up on a
# particular browsers documentation might point to differences
# discovered. The majority of regexp syntax is typically the same.
class Regexp
  def inspect
    `return self.toString();`
  end

  def ==(other)
    `return self.toString() === other.toString() ? Qtrue : Qfalse;`
  end

  def eql?(other)
    self == other
  end

  def match(pattern)
    nil
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-0.3.2 gems/core/lib/core/regexp.rb