Connecting Tech Pros Worldwide Forums | Help | Site Map

Regular expression to delete tags only containing whitespace

Newbie
 
Join Date: Oct 2009
Posts: 2
#1: Oct 14 '09
I am trying to delete the following from my file:
<Body>

</Body>

I have tried searching for <Body>[\s]+</Body> and <Body>\s+</Body> but neither works.

Thank you for any help.

gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,136
#2: Oct 16 '09

re: Regular expression to delete tags only containing whitespace


basicly your value doesn't contain only whitespaces in case it looks like you have shown. it also contains linefeeds ... so try:

Expand|Select|Wrap|Line Numbers
  1. <body>[ \n]+<\/body>
for the match.

kind regards
Newbie
 
Join Date: Oct 2009
Posts: 2
#3: Oct 16 '09

re: Regular expression to delete tags only containing whitespace


Thanks so much for your help.
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,136
#4: Oct 16 '09

re: Regular expression to delete tags only containing whitespace


no problem ... glad when it has helped :)

kind regards
Reply