5
votes
Accepted
sed: why my regex does not work correctly
[^\"] means “any character except \ and "”; so nothing ends up replaced. You’ll get the result you’re after if you remove the backslash from the bracket expression:
sed -e 's/\"\([^&...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sed × 7393awk × 2895
text-processing × 2361
bash × 973
grep × 972
regular-expression × 901
shell-script × 856
linux × 833
shell × 428
perl × 421
replace × 231
scripting × 185
command-line × 182
csv × 163
find × 134
xml × 134
string × 124
text-formatting × 124
files × 114
cut × 113
macos × 100
quoting × 84
json × 77
tr × 75
variable × 66