class Utils::Patterns::RegexpPattern

regexp_pattern.match(‘FOO’) # => matches because case insensitive
regexp_pattern = RegexpPattern.new(pattern: ‘foo’, icase: true)
@example
by the case sensitivity configuration inherited from the parent class.
throughout the application. The pattern matching behavior is influenced
pattern into a Regexp object that can be used for matching operations
creating and using regular expression patterns. It compiles the provided
This class extends the base Pattern class to provide functionality for
with optional case sensitivity.
A regular expression pattern matcher that performs exact string matching

def initialize(opts = {})

Returns:
  • (Regexp) - a compiled regular expression object ready for pattern matching operations

Options Hash: (**opts)
  • :pattern (String) -- the pattern string to be used for matching
  • :icase (TrueClass, FalseClass) -- whether the pattern matching should be case sensitive
  • :cset (String) -- the character set to filter pattern characters against

Parameters:
  • opts (Hash) -- a hash containing the pattern configuration options
def initialize(opts = {})
  super
  @matcher = Regexp.new(
    @pattern, @icase ? Regexp::IGNORECASE : 0
  )
end