Skip to content

regex [sS] or [kK] matches U+017F and U+212A inconsistently #676

Open

Description

@robertmorelli

issue:
a|[sS] matches ſ (U+017F), a|[kK] matches K (U+212A), with no case-insensitive flag. The character class alone and the spelled-out alternation do not match.

repro:

#include <re2/re2.h>
#include <cstdio>
int main() {
  printf("%d\n", RE2::FullMatch("\u017F", "a|[sS]"));  // 1
  printf("%d\n", RE2::FullMatch("\u017F", "[sS]"));    // 0
  printf("%d\n", RE2::FullMatch("\u017F", "a|s|S"));   // 0
  printf("%d\n", RE2::FullMatch("\u212A", "a|[kK]"));  // 1
  printf("%d\n", RE2::FullMatch("\u212A", "[kK]"));    // 0
  printf("%d\n", RE2::FullMatch("\u212A", "a|k|K"));   // 0
}

expected:
prints 0 for all six

system:
RE2 2025-11-05 (Homebrew)
macOS 27.0 (build 26A428), arm64

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions