In that case, this should work:

my $string =~ s/\^[AM]//gi;

I think you just have to escape the '^'.

-----Original Message-----
From: Anurag K. Singh [mailto:AnuragS@;Amdocs.com]
Sent: Tuesday, October 22, 2002 12:33 AM
To: 'Timothy Johnson'; '[EMAIL PROTECTED]'
Subject: RE: Control characters in file.


Yes , they are literally "^A".These characters appears in the file
when a ascii file was ftp'ed to a unix machine in binary mode.
    I don't have that ascii file now , so i have to correct this 
file in unix.

-----Original Message-----
From: Timothy Johnson [mailto:tjohnson@;sandisk.com]
Sent: Tuesday, October 22, 2002 8:12 AM
To: 'Anurag K. Singh'; '[EMAIL PROTECTED]'
Subject: RE: Control characters in file.



This might sound like a stupid question, but are they literally "^A", etc.,
or do you mean the character created by pressing ^A?  Because if it's the
latter, then you might be able to do something like this:

        my $string =~ s/\eA//gi;

(According to 'perldoc perlre' '\e' denotes an escape)

-----Original Message-----
From: Anurag K. Singh [mailto:AnuragS@;Amdocs.com]
Sent: Tuesday, October 22, 2002 12:07 AM
To: '[EMAIL PROTECTED]'
Subject: Control characters in file.



hi all,

I have control characters ( like ^A , ^M ) in my ascii input file 
and I want to substitute them by space or just delete them.
         Can  anyone suggest a regex for this substitution ???


Thanks

Anurag Kumar Singh 
AMDOCS DEVELOPMENT LTD. 
Limassol , Cyprus. 
Phone: +357-25-845384(O) 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to