Re: [MacPerl-AnyPerl] Let perl replase words

2006-10-07 Thread Jeff Lowrey

$head =~ s/($replace)/$1<\/u>/gi;




[MacPerl-AnyPerl] Let perl replase words

2006-10-07 Thread Eelco Alosery

Hello,

I have a small, (maby big) problem.

Im writing a search script for my site, and wand to do some replacing  
of words.


I have a string that contains for example this :
Test this is a smal test script line.

Now i have a search patern :
test

What i want to do is this.
Test and test must be replased by Test and test

Thus al (case insensative) matches to test must be converted to bold  
words.


I have tested a lot, and the best result sovar is this code :
$head =~ s/$replace/$replace<\/u>/gi;

But this code replases Test to test it is realy convertet to  
the original search patern.


Any help whit this is very welcome.

Thanks,
Eelco Alosery