I am looking for a Linux command-line utility that can do text replacement (think sed
or sd
) and is able to automatically extend your search-and-replace pattern to strings that have different word separation methods. By word separation I mean things like hyphens/underscores/spaces between words, camelCase
, UpperCamelCase
, etc.
So if you told it to replace an example string
with another example string
, it could, with minimal effort on the user's part (e.g. adding some CLI options), also replace an-example-string
with another-example-string
, anExampleString
with anotherExampleString
, and so on.
Keywords for other people searching: case-preserving replace