Class Regexp
In: lib/facets/core-uncommon/facets/regexp/op_or.rb
Parent: Object

Methods

|  

Public Instance methods

Operator form of `Regexp.union`:

  /a/ | /b/  #=> /(a|b)/

NOTE: This is not (presently) a common core extension and is not loaded automatically when using require ‘facets‘.

[Source]

# File lib/facets/core-uncommon/facets/regexp/op_or.rb, line 9
  def |(arg)
    Regexp.union(self, arg.is_a?(Regexp) ? arg : arg.to_s)
  end

[Validate]