Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0139495
sed: implement \\U \\L \\u \\l \\E case-conversion escapes in s/// (f…
dedsec-terminal Sep 15, 2026
d70106b
style: apply cargo fmt to case-conversion code
dedsec-terminal Sep 16, 2026
16fbf0f
perf: fast paths for replacements without case conversion
dedsec-terminal Sep 16, 2026
8f7ff3c
test: cover case-conversion fast paths and parser flag
dedsec-terminal Sep 17, 2026
eebcedd
refactor: address review feedback on case-conversion escapes
dedsec-terminal Sep 22, 2026
579af5c
perf(subst): avoid intermediate buffer allocations in substitution re…
dedsec-terminal Sep 22, 2026
e5e186a
refactor(subst): address review feedback on case-conversion escapes
dedsec-terminal Sep 22, 2026
4a78919
fix(subst): address maintainer review and fix GNU escape compatibility
dedsec-terminal Sep 30, 2026
6020508
fix(subst): preserve delimiter precedence for digits and & in replace…
dedsec-terminal Oct 3, 2026
bcc66cc
fix(subst): preserve persistent case conversion across invalid UTF-8 …
dedsec-terminal Oct 5, 2026
250a668
refactor(subst): address maintainer review feedback on case-conversio…
dedsec-terminal Oct 10, 2026
cf224e6
fix(subst): restore fast paths, encapsulate case flags, and drop unkn…
dedsec-terminal Oct 14, 2026
e2bbe84
refactor(subst): address latest maintainer review feedback
dedsec-terminal Oct 18, 2026
4fbcf14
style: apply rustfmt to replacement changes
dedsec-terminal Oct 22, 2026
ea5709d
fix(subst): keep upstream unknown-escape handling
dedsec-terminal Oct 22, 2026
90c960d
Address replacement case conversion review feedback
dedsec-terminal Nov 19, 2026
7486c2f
Merge upstream main into case conversion branch
dedsec-terminal Nov 19, 2026
55a064f
test: match GNU sed case escapes in replacements
dedsec-terminal Nov 19, 2026
f57c6f3
Use simple Unicode case mappings in sed replacements
dedsec-terminal Nov 19, 2026
82f6fdc
Merge upstream main and preserve POSIX capture handling
dedsec-terminal Nov 22, 2026
900328d
Clarify GNU replacement case directives in README
dedsec-terminal Nov 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 65 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ xattr = "1.3.1"
[dependencies]
clap = { workspace = true }
fancy-regex = { workspace = true }
icu_casemap = "2.4.0"
memchr = { workspace = true }
memmap2.workspace = true
predicates = { workspace = true }
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ cargo test
## Extensions and incompatibilities
The GNU, BSD and new extensions _sed_ supports, and where it differs from GNU
_sed_, are listed in [docs/src/extensions.md](docs/src/extensions.md).
In substitution replacements, `\u` and `\l` uppercase or lowercase only
the next character, respectively. `\U` and `\L` uppercase or lowercase
the rest of the replacement unless another persistent directive switches the
case or `\E` ends conversion. `\E` also clears any pending one-character
conversion. Numeric Unicode escapes (`\uXXXX` and `\UXXXXXXXX`) are supported
in patterns and transliterations.

## GNU test suite compatibility

Expand Down
12 changes: 10 additions & 2 deletions docs/src/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ Below is a list of these extensions and incompatibilities.
* Address steps can be specified in the form of start~step and start,~step
ranges.
* Address 0 can be used in the `r` command to prepend a file.
* GNU `s///` replacement case-conversion escapes:
Comment thread
dedsec-terminal marked this conversation as resolved.
Resolved
- `\U`: Turn replacement text to uppercase until `\L` or `\E`.
- `\L`: Turn replacement text to lowercase until `\U` or `\E`.
- `\u`: Turn the next character to uppercase (one-shot).
- `\l`: Turn the next character to lowercase (one-shot).
- `\E`: Terminate persistent conversion started by `\U` or `\L` and clear any pending one-shot conversion.

## Supported BSD and GNU extensions
* The second address in a range can be specified as a relative address with +N.
Expand All @@ -39,8 +45,10 @@ Below is a list of these extensions and incompatibilities.
`--in-place=.bak`); BSD's `-i .bak` and `-i ''` are not supported.

## New extensions
* Unicode characters can be specified in regular expression pattern, replacement
and transliteration sequences using `\uXXXX` or `\UXXXXXXXX` sequences.
* Unicode characters can be specified in regular expression patterns and
transliteration sequences using `\uXXXX` or `\UXXXXXXXX` sequences. In
substitution replacements, `\u`, `\U`, `\l`, `\L`, and `\E` are GNU
case-conversion directives.
* On a terminal, script errors also quote the script line and underline the
character at fault (`UUTILS_DIAG=always` or `never` overrides this):
```
Expand Down
Loading
Loading