From e9e3a4d32681e4ac0713187e698eb73679ccb27c Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Tue, 3 Mar 2020 16:34:14 +1100 Subject: [PATCH] Readme: fix the sed slashes example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 642cc1f..fde385e 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Some cherry-picked examples, where `sd` shines: - Extracting stuff out of strings containing slashes: - sd: `echo "sample with /path/" | sd '.*(/.*/)' '$1'` - sed: use different delimiters every time depending on expression so that the command is not completely unreadable - - `echo "sample with /path/" | sed -E 's/.*(/.*/)/\1/g'` + - `echo "sample with /path/" | sed -E 's/.*(\\/.*\\/)/\1/g'` - `echo "sample with /path/" | sed -E 's|.*(/.*/)|\1|g'` - In place modification of files: - sd: `sd before after file.txt`