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

Drop MATCH_INVALID_UTF #13313

Conversation

straight-shoota
Copy link
Member

This patch drops the implicit MATCH_INVALID_UTF option which was added as part of a bug fix in #13240.

Instead this option is now available in Regex::CompileOptions for opt-in.
Similarly, NO_CHECK_UTF members are added to Regex::CompileOptions and Regex::MatchOptions.
Regex::CompileOptions::NO_CHECK_UTF is identical to the already existing but undocumented NO_CHECK_UTF8 member.

Resolves #13312

src/regex.cr Outdated Show resolved Hide resolved
src/regex.cr Show resolved Hide resolved
#
# Unsupported with PCRE.
#
# NOTE: This option was introduced in PCRE2 10.34 but a bug that can lead to an
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That deserves a stronger marker IMO.

Suggested change
# NOTE: This option was introduced in PCRE2 10.34 but a bug that can lead to an
# WARNING: This option was introduced in PCRE2 10.34 but a bug that can lead to an

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine. If you want to use a feature of any library you must make sure it's supported in the library version you're linking against. That's a general axiom. Here we're just pointing out the relevant versions for this particular option.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're pointing not only the version but also the fact it contains a rather serious bug.

@straight-shoota straight-shoota added this to the 1.8.0 milestone Apr 13, 2023
@straight-shoota straight-shoota merged commit 45c5296 into crystal-lang:master Apr 13, 2023
@straight-shoota straight-shoota deleted the feature/regex-drop-invalid-utf branch April 13, 2023 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop MATCH_INVALID_UTF
3 participants