Bullock, Howard A. wrote:
I want to alter some characters in a text variable, but only those between two markers.

$text = 'axxxccvvvaca<s>sdcxaswrefa<e>jjawera<s>sdcxaswrefa<e>jhhaasera';

I want to specify the start <s> and the end <e> and only change the a's to 8's between the markers. How do I accomplish this?

$text =~ s/<s> find a's <e>/g;
You could cheat a little instead of trying to do it with just a RE, use
an embeded tr/// or s///:

my $text = 'axxxccvvvaca<s>sdcxaswrefa<e>jjawera<s>sdcxaswrefa<e>jhhaasera';

$text =~ s#<s>(.*?)<e># my $x = $1; $x =~ tr/a/8/; sprintf '<s>%s<e>', $x #eg;

--
  ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
 (_/   /  )    // //       DBE Collectibles   Mailto:dbe@;todbe.com
  / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to