CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
PLEASE HELP!!! - Problem Translating

 



QuestOFions
Deleted

May 15, 2000, 3:36 PM

Post #1 of 2 (537 views)
PLEASE HELP!!! - Problem Translating Can't Post

I have a document with many <br> and I wanted to get rid of them so I used this:

$r = -1;
for ($e=0; $e <= $aa; $e++) {
$r++;
$catagorylines[$i+$r] =~ tr/<br>/ /;
print "$catagorylines[$i+$r]";
}

The only problem is that it got rid of all <, b, r, and >. What do I need to add to specify <br>?


mckhendry
Deleted

May 16, 2000, 6:14 AM

Post #2 of 2 (537 views)
Re: PLEASE HELP!!! - Problem Translating [In reply to] Can't Post

Have you tried grouping the regex together using parentheses? You would do it like this:

tr/(<br> )//i;

the i at the end will ignore case (if you ned that), and the parentheses serve as a grouping operator. Look at Rule 6 of regular expressions in the Camel book by O'Reilly (p. 64). Hope this helps.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives