I am trying to replace test004.abc.com with eh6.test004.abc.com.
The csv file has rows
scheme,host,Username,Password
https,test003.abc.com,test003_0021,abc1!
https,test046.abc.com,test046_015,abc1!
....
I have this sed which I am trying
sed -i -E "s/(https,)(test\d{3}\.abc\.com,test\d{3}_\d{3,},abc\!)/\1eh6.\2/g" EH6_Random.csv
but its throwing error
sed: 1: "s/(https,)(test\d{3 ...": \1 not defined in the RE
since I am using -E there shouldn't be need of escaping the regular expression fo group brackets (). I have tried this as well and removed -E , but it still didnt work.