-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
The pattern syntax of sad differs from that sed in that $ is used instead of \ in the output pattern to reference capture groups. For instance,
sed 's/pre_(\w*)_suf/\1'
is analogous to
sad 'pre_(\w*)_suf' '$1'
This feature is unfortunately not very discoverable at the moment (I had to resort to trial and error). Perhaps it could be added to the help for replace? E.g.
/// Replacement pattern, empty = delete, $<group_no> for regex captures
#[clap()]
pub replace: Option<String>,
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels