This commit is contained in:
Roberto Alsina 2024-08-08 12:43:58 -03:00
parent 9709bbf62f
commit 6b8f214cf9

View File

@ -75,7 +75,7 @@ module CRe2
@failed = false @failed = false
@anchored = LibCre2::CRE2_UNANCHORED @anchored = LibCre2::CRE2_UNANCHORED
def initialize(@pattern : String, @options : Options = Options::DEFAULT) def initialize(@pattern : String, @options : Options = Options::None)
@source = @pattern @source = @pattern
@re = Regex::PCRE2.compile(pattern, pcre2_options(@options)) do |error_message| @re = Regex::PCRE2.compile(pattern, pcre2_options(@options)) do |error_message|
raise Exception.new(error_message) raise Exception.new(error_message)