Skip to content
Advertisement

Tag: backreference

How to use back-reference of sed replacement command correctly considering a special Regular Expression

I am learning the sed s/regexp/replacement/ command on linux. There are some numbers from phone.txt I’d like to use the regular expression (which I have tested on https://www.freeformatter.com/regex-tester.html) to match numbers which begin with (555). And then I want the output of these three parts of these matched number as: (an example for number (555)555-1212) I tried the following command:

Advertisement