From 9709bbf62fda990c58df3ec322e09a0152942421 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Thu, 8 Aug 2024 12:35:34 -0300 Subject: [PATCH] A thing --- src/cre2.cr | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/src/cre2.cr b/src/cre2.cr index 35aaba4..593e136 100644 --- a/src/cre2.cr +++ b/src/cre2.cr @@ -136,30 +136,13 @@ module CRe2 end end -re = CRe2::Regex.new(".*(x).*", Regex::Options::ANCHORED | Regex::Options::MULTILINE) -m = re.match("axb") -p! m.try &.[0] -p! m.try &.[1] +# re = CRe2::Regex.new(".*(x).*", Regex::Options::ANCHORED | Regex::Options::MULTILINE) +# m = re.match("axb") +# p! m.try &.[0] +# p! m.try &.[1] -re = Regex.new(".*(x).*", Regex::Options::ANCHORED | Regex::Options::MULTILINE) -m = re.match("axb") -p! m.try &.[0] -p! m.try &.[1] +# re = Regex.new(".*(x).*", Regex::Options::ANCHORED | Regex::Options::MULTILINE) +# m = re.match("axb") +# p! m.try &.[0] +# p! m.try &.[1] -# match = Pointer(LibCre2::StringPiece).malloc(10) -# opts = LibCre2.opt_new -# LibCre2.opt_posix_syntax(opts, true) -# LibCre2.opt_longest_match(opts, true) -# LibCre2.opt_perl_classes(opts, true) -# LibCre2.opt_encoding(opts, 1) -# # LibCre2.opt_one_line(opts, false) -# # LibCre2.opt_never_nl(opts, false) - -# pattern = "(\\s+)(foo)" -# text = " foo" -# re = LibCre2.new(pattern, pattern.size, opts) -# p! LibCre2.match(re, text, text.size, 0, text.size, -# LibCre2::CRE2_ANCHOR_START, match, 10) -# (0...10).each do |i| -# p! String.new(Slice.new(match[i].data, match[i].length)) -# end