just another method $str = q/[EMAIL PROTECTED]/; if ($str=~ /(\S*)(\@)(\S*)/) { $s=$3; $s=~tr|_|.|; $str=$1.$2.$s; }
abhi ----- Original Message ----- From: "Ramprasad A Padmanabhan" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "perl beginners" <beginners@perl.org> Sent: Thursday, March 31, 2005 3:13 PM Subject: quick regex question > Hi, > > I want to run a substitution for all instances of "_" with "." after > '@' in a string but "_" before "@" should not be touched. > > eg > $str = "[EMAIL PROTECTED]"; > > Should become > > [EMAIL PROTECTED] > > > > Any suggestions > Thanks > Ram > > > ---------------------------------------------------------- > Netcore Solutions Pvt. Ltd. > Website: http://www.netcore.co.in > Spamtraps: http://cleanmail.netcore.co.in/directory.html > ---------------------------------------------------------- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>