The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



Thread: sed regex
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 01-31-2002
Perderabo's Avatar
Perderabo Perderabo is online now
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,459
Try:
sed 's=\(<[Ii][Mm][Gg],[0-9,]*>\)prod/=\1special/='

As for the equals sign, my sed man page, as it describes the s command, says "Any character can be used instead of /." Slash wasn't a good choice here since the data also contains a slash. Had I used a slash for the delimiter, I would have had to backslash any slashes that weren't delimiters. Switching delimiters eliminates the need for the backslashes.