class Mustermann::Regular

Regexp pattern implementation.

@example

Mustermann.new('/.*', type: :regexp) === '/bar' # => true

@see Mustermann::Pattern @see file:README.md#simple Syntax description in the README

Public Class Methods

new(string, check_anchors: true, **options) click to toggle source

@param (see Mustermann::Pattern#initialize) @return (see Mustermann::Pattern#initialize) @see (see Mustermann::Pattern#initialize)

Calls superclass method Mustermann::RegexpBased.new
# File lib/mustermann/regular.rb, line 22
def initialize(string, check_anchors: true, **options)
  string = $1 if string.to_s =~ /\A\(\?\-mix\:(.*)\)\Z/ && string.inspect == "/#$1/"
  string = string.source.gsub!(/(?<!\)(?:\s|#.*$)/, '') if extended_regexp?(string)
  @check_anchors = check_anchors
  super(string, **options)
end