[CMI.PM] String matching sanity check?

Jay A. Kreibich jak at uiuc.edu
Wed May 25 14:19:54 PDT 2005


On Wed, May 25, 2005 at 04:14:47PM -0500, Mitch Kutzko scratched on the wall:
> Hi, folks -- I'm trying to do some substitutions on some email archive
> files, and convert the "@" in any email addresses found in the Subject:
> line to " --at-- ".
> 
> I'm trying this just to test with right now:
> 
>   #!/usr/bin/perl -pi.old
>   s/Subject: \(.*\)@\(.*\)/Subject: \1 --at-- \2/g;

  You're escaping the ()'s, so it is looking for literal ()s.  If you
  want to group things for the replacement, don't escape the ()s.

   -j

-- 
                     Jay A. Kreibich | CommTech, Emrg Net Tech Svcs
                        jak at uiuc.edu | Campus IT & Edu Svcs
          <http://www.uiuc.edu/~jak> | University of Illinois at U/C


More information about the Champaign-Urbana mailing list