[luau] Perl String Question

Taylor Cody L. Contr 502 AOS/PETS Cody.Taylor at hickam.af.mil
Thu Mar 25 10:14:30 PST 2004


It looks like you already have your answer but since my friend replied I
figured I would forward it on.  -Cody
 
-----Original Message-----
From: Paul 
 
$string =~ s\(<b>|</b>)\\;
 
FYI -
Normally those backslashes would be forward slashes, but since his 
search string contains forward slashes, you can use another symbol to 
keep perl from getting confused. For instance, I could have wrote 
s*(<b>|</b>)** instead and it would have meant the same thing.

-----Original Message-----
From: Matthew John Darnell [mailto:mdarnell at servpac.com]
Sent: Wednesday, March 24, 2004 5:48 PM
To: luau at videl.ics.hawaii.edu
Subject: [luau] Perl String Question


Aloha,
 
If I have a string "<b>Yo ho ho and a bottle of rum</b>" is there an elegant
way to eliminate the '<b>' & '</b>'?
 
It would also need to return nothing for the string "<b></b>"
 
I could hack something up, but I am thinking it could be accomplished in one
line of code.  I am sure there is more than one way to do it.
 
As you probably guessed, I am parsing a web page.
 
-Matt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freesoftwarehawaii.org/pipermail/luau-freesoftwarehawaii.org/attachments/20040325/cc2684c0/attachment-0001.htm>


More information about the LUAU mailing list