Welcome to WebmasterWorld Guest from 54.158.167.59

Forum Moderators: open

Message Too Old, No Replies

Regular expressions in NeoOffice Calc

   
4:50 pm on Jun 16, 2008 (gmt 0)

5+ Year Member



I have a CSV file, exported from mySQL, which I'm trying to update. What I want to achieve is to replace the <div> tags with <p> tags.

I can find this search term in the document:

<div class="className">.*</div>

but this one does not work:

<div class=\"className\">[A-z]+</div>

I'm not sure what to replace this with, because I want the content between the div tags to stay in place.

e.g.

<p class="className">Content to stay in place</p>

I have also tried searching across multiple lines with this expression (white space, new line, white space):

</div>\s*\n*\s*<div class="className2">
, but have not found any matches.

Also, could you please explain the use of

\1
and
$1
?

I'm very much a newbie at this, so would appreciate any advice. I've had a look at some of the Regex posts on the Perl forum, but that's not down my alley.