google / google/re2j

Asymmetric behavior for case-insensitive matches

Open
#198 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.3k
Forks
165
PR merge metrics
No merged PRs in 30d

Description

Case-insensitive matching with Unicode category `\p{Ll}` (lowercase letters) does not include uppercase equivalents.

```
// (?i)\p{Lu} correctly matches both cases:
RE2.compile("(?i)\\p{Lu}").matches("A") // true
RE2.compile("(?i)\\p{Lu}").matches("a") // true
// (?i)\p{Ll} only matches lowercase — the (?i) flag has no effect:
RE2.compile("(?i)\\p{Ll}").matches("a") // true
RE2.compile("(?i)\\p{Ll}").matches("A") // false — expected true
```
The same applies to `\p{Lt}` (titlecase) which is missing uppercase equivalents. Affects all scripts (Latin, Cyrillic, Greek, Armenian, etc.).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.