module Regin

Constants

POSIX_BRACKET_TYPES
Version

Public Class Methods

compile(source) click to toggle source

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)

# File lib/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) click to toggle source

Parses Regexp and returns a Expression data structure.

# File lib/regin.rb, line 62
def self.parse(regexp)
  Parser.parse_regexp(regexp)
end
regexp_supports_named_captures?() click to toggle source

Returns true if the interpreter is using the Oniguruma Regexp lib and supports named captures.

/(?<foo>bar)/
# File lib/regin.rb, line 22
def self.regexp_supports_named_captures?
  true
end
supported_posix_bracket_types() click to toggle source

Returns array of supported POSX bracket types

# File lib/regin.rb, line 41
def self.supported_posix_bracket_types
  @supported_posix_bracket_types ||= []
end