All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.
- Fixed pre-allocated memmap buffer size
- Fixed failing tests
sd
now uses memory-mapped files, allowing replacement on files of any size-p
/--preview
flag is now added to preview changes- as of right now, results are simply emitted to stdout
- in a future version, the output will be changed to contain only relevant information
- a
w
regex flag is added to match full words only, e.g.sd -f w foo bar file.txt
--in-place
is now deprecated and assumed whenever a list of files is given
- Windows support (thanks to @ErichDonGubler)
- Support for unicode and special characters (like
\n
) in replacement expressions- Only in regex mode
- Fixed edge-cases when replacing content containing unescaped characters
- Significant performance improvements (see benchmarks in README)
- Option to set regex flags via
-f
or--flags
:m
(multi-line)c
(case-sensitive)i
(case-insensitive)
- Smart case-sensitivity is used by default with regular expressions
- You may now pass multiple files to
sd
- this is now valid:
sd -i "\n" "," *.txt
- this is now valid:
Breaking Change: the -i
/--input
is revamped per #1. The file path now comes at the end, instead of -i
.
Transforming the file in-place:
- Before:
sd -s 'str' '' -i file.txt'
- Now:
sd -i -s 'str' '' file.txt
- Future:
sd -i -s 'str' '' *.txt
To reflect this change, --input
is also renamed to --in-place
. This is the first and most likely the last breaking change in this project.
- Files are now written to atomically