-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: The translation needs to be implemented in pcre_compile_options
as well.
Also would be nice to have some specs for testing the behaviour.
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
Regex::CompileOptions::MULTILINE_ONLY
Re-added the special handling for MULTILINE (setting MULTILINE and DOTALL) because removing it broke a test. The remaining test failure happens on main too (at spec/std/regex_spec.cr:19) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The case for MULTILINE
is only necessary because the value of MULTILINE_ONLY
is not a composite of MULTILINE
. Change it to 0x0000_0004
and it should work.
And the test failure is in fact introduced by this change because the test uses 0x0000_0040
as an undefined option value (but is now defined).
Co-authored-by: Johannes Müller <[email protected]>
Adds a new MULTILINE_ONLY flag to regexes.
I created an issue here:
#14869
As discussed here:
https://forum.crystal-lang.org/t/regex-that-is-multiline-but-not-dotall-how/7054/12