Oct 1, 2002 #1 OieL MIS Joined Sep 6, 2002 Messages 17 Location US Hi I want to get data from an HTML file. the lines that I want to put into an array is after the <PRE> and before the </PRE> tag <HTML> ; ; <PRE> line 1 line 2 line 3 </PRE> ; ; ; </HTML> help
Hi I want to get data from an HTML file. the lines that I want to put into an array is after the <PRE> and before the </PRE> tag <HTML> ; ; <PRE> line 1 line 2 line 3 </PRE> ; ; ; </HTML> help
Oct 2, 2002 #2 goBoating Programmer Joined Feb 8, 2000 Messages 1,606 Location US Code: $html_stuff = qq(<HTML> <head><title>Junk</title> </head> <body> <PRE> line 1 line 2 line 3 </PRE> </body></HTML>); if ($html_stuff =~ /<pre>(.*?)<\/pre>/is) { $pre_tags_had = $1; } else { print "No Luck, buddy.\n"; } I think that will grab the content of the first set of pre tags. 'hope this helps If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo. Upvote 0 Downvote
Code: $html_stuff = qq(<HTML> <head><title>Junk</title> </head> <body> <PRE> line 1 line 2 line 3 </PRE> </body></HTML>); if ($html_stuff =~ /<pre>(.*?)<\/pre>/is) { $pre_tags_had = $1; } else { print "No Luck, buddy.\n"; } I think that will grab the content of the first set of pre tags. 'hope this helps If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.