Skip to content

feat(rg): honor ascii regex mode - #1681

Merged
chaliy merged 1 commit into
mainfrom
2026-05-22-rg-batch-7
May 22, 2026
Merged

chaliy merged 1 commit into
mainfrom
2026-05-22-rg-batch-7

Conversation

@chaliy

@chaliy chaliy commented May 22, 2026

Copy link
Copy Markdown
Contributor

What

Adds real rg parity for --unicode/--no-unicode regex mode handling.

Why

--no-unicode was previously accepted as a no-op, so regex word classes and word boundaries still used Unicode behavior instead of real rg's ASCII mode.

How

  • Tracks Unicode regex mode in rg options and passes it to RegexBuilder.
  • Skips indexed regex search when --no-unicode needs ASCII regex semantics the index cannot represent.
  • Adds unit and differential tests for non-ASCII \w and -w behavior against real rg.
  • Updates help text to describe --unicode/--no-unicode as real regex mode flags.

Risk

  • Low
  • Could affect searches using --no-unicode with regex syntax, which is the intended parity change.

Checklist

  • Tests added or updated
  • Backward compatibility considered

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 13ec1d3 Commit Preview URL May 22 2026, 04:48 PM

@chaliy
chaliy merged commit 4c2458e into main May 22, 2026
34 checks passed
@chaliy
chaliy deleted the 2026-05-22-rg-batch-7 branch May 22, 2026 17:01
chaliy added a commit that referenced this pull request May 30, 2026
## What
Adds real rg parity for --unicode/--no-unicode regex mode handling.

## Why
--no-unicode was previously accepted as a no-op, so regex word classes
and word boundaries still used Unicode behavior instead of real rg's
ASCII mode.

## How
- Tracks Unicode regex mode in rg options and passes it to RegexBuilder.
- Skips indexed regex search when --no-unicode needs ASCII regex
semantics the index cannot represent.
- Adds unit and differential tests for non-ASCII \w and -w behavior
against real rg.
- Updates help text to describe --unicode/--no-unicode as real regex
mode flags.

## Risk
- Low
- Could affect searches using --no-unicode with regex syntax, which is
the intended parity change.

## Checklist
- [x] Tests added or updated
- [x] Backward compatibility considered
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant