Module: Regin

Defined in:
lib/rack/mount/vendor/regin/regin.rb,
lib/rack/mount/vendor/regin/regin/atom.rb,
lib/rack/mount/vendor/regin/regin/group.rb,
lib/rack/mount/vendor/regin/regin/anchor.rb,
lib/rack/mount/vendor/regin/regin/parser.rb,
lib/rack/mount/vendor/regin/regin/options.rb,
lib/rack/mount/vendor/regin/regin/version.rb,
lib/rack/mount/vendor/regin/regin/character.rb,
lib/rack/mount/vendor/regin/regin/collection.rb,
lib/rack/mount/vendor/regin/regin/expression.rb,
lib/rack/mount/vendor/regin/regin/alternation.rb,
lib/rack/mount/vendor/regin/regin/character_class.rb

Defined Under Namespace

Classes: Alternation, Anchor, Atom, Character, CharacterClass, Collection, Expression, Group, Options, Parser

Constant Summary collapse

POSIX_BRACKET_TYPES =
%w(
  alnum alpha ascii blank cntrl digit graph
  lower print punct space upper word xdigit
  foo
)
Version =
'0.3.7'

Class Method Summary collapse

Class Method Details

.compile(source) ⇒ Object

Recompiles Regexp by parsing it and turning it back into a Regexp.

(In the future Regin will perform some Regexp optimizations such as removing unnecessary captures and options)



70
71
72
73
74
# File 'lib/rack/mount/vendor/regin/regin.rb', line 70

def self.compile(source)
  regexp = Regexp.compile(source)
  expression = parse(regexp)
  Regexp.compile(expression.to_s(true), expression.flags)
end

.parse(regexp) ⇒ Object

Parses Regexp and returns a Expression data structure.



62
63
64
# File 'lib/rack/mount/vendor/regin/regin.rb', line 62

def self.parse(regexp)
  Parser.parse_regexp(regexp)
end

.supported_posix_bracket_typesObject

Returns array of supported POSX bracket types



41
42
43
# File 'lib/rack/mount/vendor/regin/regin.rb', line 41

def self.supported_posix_bracket_types
  @supported_posix_bracket_types ||= []
end