Skip to content

Only escape the regex chars that have a meaning with --literal to close #686 - #746

Merged
mathiasrw merged 5 commits into
mainfrom
fix/686
Oct 23, 2026
Merged

mathiasrw merged 5 commits into
mainfrom
fix/686

Conversation

@mathiasrw

Copy link
Copy Markdown
Owner

Closes #686

Stacked on #745. Merge that first.

Change

  • --literal only escapes [ ] { } ( ) * + ? . / \ ^ $ |. These are the chars with a meaning outside a character class.
  • -, ,, # and whitespace are no longer escaped. Unicode mode (--unicode) does not allow to escape a char without a meaning, so \-, \,, \# and \ gave an invalid regex.
  • The test.todo for --literal with --unicode rejects patterns containing -, ,, # or whitespace #686 is now a real test, with each char that can be in a literal pattern.

@mathiasrw
mathiasrw changed the base branch from fix/733 to main October 22, 2026 23:23
@mathiasrw
mathiasrw added this pull request to stack #765 October 23, 2026 00:30
@mathiasrw
mathiasrw merged commit 447c22c into main Oct 23, 2026
7 checks passed
@mathiasrw
mathiasrw deleted the fix/686 branch October 23, 2026 00:33
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.

--literal with --unicode rejects patterns containing -, ,, # or whitespace

1 participant