progolf069
Programmer
Greetings,
I have a quick, appears to be easy, question about replacing text in a string. I am trying to display on a web page the registered trademark, trademark, and copyright symbols out of a Postgresql database. These data items are being representated in the data like this:
Trademark: (tm) or (TM)
Copyright: (c) or (C)
Registred Trademark: (r) or (R)
An example record would be something like this:
American Tourister(r) Forester(tm) II Collection - Ultravalet(r) Garment.
Anywhere there is a (r) or a (tm) in the above statement, should be replaced with the following text:
-+-+-+-+-+-+-+-+-+
I have tried using a simple replace feature as followed, but I am am getting these reults
If anybody can assist me in figuring out how to code this, I would be very appreciative. Thanks for any replys that you may give.
God Bless You,
Ian Wickline
I have a quick, appears to be easy, question about replacing text in a string. I am trying to display on a web page the registered trademark, trademark, and copyright symbols out of a Postgresql database. These data items are being representated in the data like this:
Trademark: (tm) or (TM)
Copyright: (c) or (C)
Registred Trademark: (r) or (R)
An example record would be something like this:
American Tourister(r) Forester(tm) II Collection - Ultravalet(r) Garment.
Anywhere there is a (r) or a (tm) in the above statement, should be replaced with the following text:
Code:
Trademark: <SMALL><SUP>TM</SUP></SMALL>
Copyright: & #169
Registred Trademark: & #174
-+-+-+-+-+-+-+-+-+
I have tried using a simple replace feature as followed, but I am am getting these reults
Code:
$item1 = 'American Tourister(r) Forester(tm) II Collection - Ultravalet(r) Garment';
$item1 =~ s/(tm)/<SMALL><SUP>TM</SUP></SMALL>/;
$item1 =~ s/(r)/& #174/;
$item1 =~ s/(c)/& #169/;
print "$item1";
Result: Ame®i©an Tourister(r) Forester(tm) II Collection - Ultravalet(r) Garment
If anybody can assist me in figuring out how to code this, I would be very appreciative. Thanks for any replys that you may give.
God Bless You,
Ian Wickline