Saturday, May 30, 2009 3:49 AM
To: Perl Beginners
Subject: Re: Matching Question
Farrell, Patrick wrote:
> This is roughly what I am trying to do. Surround lower case strings within a
> string with tags.
>
> ===
> $msgText=
This is roughly what I am trying to do. Surround lower case strings within a
string with tags.
===
$msgText="THIS IS MY test STRING";
$msgText =~ m/ [a-z]+ /; #or $msgText =~ /\s[a-z]+\s/;
if(defined($1)){
$1=~ s/\s+//g;
I want to replace all instances of
~someString~
in a larger string with
someString
I tried the following statement:
$string =~ s/\~.*\~/.*<\/i>/g;
But what I get is a bunch of the following as the replacements:
.*
How do I retain the original .* in the replacement?
Thanks
--
To unsu