Why is this simple replacement with sed
inside bash
not working?
echo '[a](!)' | sed 's/[a](!)/[a]/'
It returns [a](!)
instead of [a]
. But why, given that only three characters need to be escaped in a sed
replacement string?
If I account for the case that additional characters need to be replaced in the regex string and try
echo '[a](!)' | sed 's/\[a\]\(!\)/[a]/'
it is still not working.