Skip to content

regex that matches without IGNORECASE doesn't match with it #170

@bcrowell

Description

@bcrowell

The following is my attempt to produce a minimal example of what looks to me like a bug in the ruby Regexp class:

e = '(?<![[:alpha:]])οὖν.*(?<![[:alpha:]])καὶ.*(?<![[:alpha:]])γ'

r1 = Regexp.new(e)
r2 = Regexp.new(e,Regexp::IGNORECASE)

s = 'π οὖν καὶ γ'

print r1.match?(s),"\n"
print r2.match?(s),"\n"

The strings contain ancient Greek characters in unicode. The output I get in ruby 3.2.3 is this:

true
false

The output should be "true true." Since IGNORECASE makes regexes easier to match, the fact that r1 matches means that r2 should also match. Both the source code of the regex and the string being tested are entirely lowercase.

Thanks for your work on Onigmo! I hope this is the right place to report this. If not, then please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions