in reply to Dealing with Regexes for a specific replacement pattern

What you need are backreferences. Try:
s/338C(\d{3}C\d{3}C\S{8})/338C$1C/g



Code is (almost) always untested.
http://www.justicepoetic.net/

Replies are listed 'Best First'.
Re: Dealing with Regexes for a specific replacement pattern
by Abigail-II (Bishop) on Feb 21, 2004 at 11:19 UTC
    Or even simpler:
    s/(338C\d{3}C\d{3}C\S{8})/$1C/g

    Abigail

      Thanks much! Appreciate it!
      /Gridlock a.k.a. Debashis "Codito Ergo Sum"