Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Regex::CompileOptions::MULTILINE_ONLY #14870

Merged
merged 15 commits into from
Oct 10, 2024
Prev Previous commit
Next Next commit
crystal tool format
  • Loading branch information
straight-shoota committed Sep 18, 2024
commit 0bdba96612ab3748cff15b5493caff92e2633efe
2 changes: 1 addition & 1 deletion src/regex.cr
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class Regex
# flag that activates both behaviours, so here we do the same by
# mapping `MULTILINE` to `PCRE_MULTILINE | PCRE_DOTALL`.
# The same applies for PCRE2 except that the native values are 0x200 and 0x400.
#
#
# For the behaviour of `PCRE_MULTILINE` use `MULTILINE_ONLY`.

# Multiline matching.
Expand Down
4 changes: 2 additions & 2 deletions src/regex/pcre.cr
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ module Regex::PCRE
if options.includes?(option)
flag |= case option
when .ignore_case? then LibPCRE::CASELESS
when .multiline? then LibPCRE::MULTILINE | LibPCRE::DOTALL
when .multiline_only? then LibPCRE::MULTILINE
when .multiline? then LibPCRE::MULTILINE | LibPCRE::DOTALL
when .multiline_only? then LibPCRE::MULTILINE
when .dotall? then LibPCRE::DOTALL
when .extended? then LibPCRE::EXTENDED
when .anchored? then LibPCRE::ANCHORED
Expand Down
Loading