![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jun 2008
Posts: 12
Rep Power: 0
![]() |
html tags replace
Hi,
I am writing a program in perl which opens and reads a html file and removes unnecessary tags. For example if an html file has... <html> <title>this is the title</title> <body> <b>this is a bold text.</b><b>this is also a bold text</b> </body> </html> Since there are unnecessary bold tags..I mean it can also be written as <b>this is a bold text.this is also a bold text</b> Please tell me if I am on the right track... I read the html file line by line. On each line when I encounter <b> tag I take the line into a temp string until I approach </b> tag...and I keep searching for any other string after that which uses the <b>immediately after this. I can make separate subroutine to remove the unnecessary <b> tags. Or should I read file by per charcter encounter. I am fairly new to perl. Please advise me. |
|
|
|
|
|
#2 | |
|
Programmer
Join Date: Oct 2007
Posts: 41
Rep Power: 0
![]() |
Re: html tags replace
Quote:
|
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jun 2008
Posts: 12
Rep Power: 0
![]() |
Re: html tags replace
I am just supposed to use regular expressions.
But I got it working now. Thanks anyways! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Optional Closing Tags in HTML | WIND | HTML / XHTML / CSS | 24 | Jan 12th, 2008 8:13 AM |
| start Learning HTMl | smita | HTML / XHTML / CSS | 0 | Mar 15th, 2007 8:38 AM |
| Basics of HTML Tutorial | crawforddavid2006 | HTML / XHTML / CSS | 14 | Jul 11th, 2006 8:40 AM |
| Basic HTML Tutorial - Reuben Keeney | ReubenK | HTML / XHTML / CSS | 14 | Mar 26th, 2006 6:50 AM |
| HTML =/= Programming | Sane | Coder's Corner Lounge | 32 | Mar 8th, 2006 3:50 AM |