Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

remove <body >

Posted on 1999-07-22
5
Medium Priority
?
183 Views
Last Modified: 2010-03-04
how to remove the <body> </body> ?
some html body is very long like below .

<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" ALINK="#003399" LINK="#003399" VLINK="#003399" bgcolor="#FFFFFF">

0
Comment
Question by:loong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1214352
#assuming nothing strange in scripts or comments or alt tags...
s'<body\b.*</\s*body\s*>''is;
0
 

Author Comment

by:loong
ID: 1214353
my code is below...

how to insert ur  please..

$string =~ s(<body>.*?<\/body>)()sgi;

0
 
LVL 84

Expert Comment

by:ozo
ID: 1214354
$string =~ s(<body.*?<\/body>)()sgi;
0
 

Author Comment

by:loong
ID: 1214355
thank
0
 

Accepted Solution

by:
samay earned 20 total points
ID: 1214356
$string =~ s(<body.*?<\/body>)()si;

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question