Multiline Regular Expression search in Dreamweaver

Hi,

I am trying to change all tables in more than 50 pages to DIV and I have been trying for an hour to get it right but I can't seem to get it right.

I found this page which can strip off multiple comment lines.
http://www.tjkdesign.com/articles/whitespace.asp

But I am trying it on table and cannot get it right.

We have tables start like these:

<table border="0" cellpadding="0" cellspacing="0" width="1000"><!--page starts here-->
<tr>
<td colspan="3">

OR

<table border="0" cellpadding="0" cellspacing="0" width="800">
<!--page starts here-->
<tr>
<td colspan="3">

OR

<table border="0" cellpadding="0" cellspacing="0" width="800">
<!--main table for page-->
<tr><td colspan="3">

OR

<table border="0" cellpadding="0" cellspacing="0" width="800">
<tr>
<td colspan="3">

etc...

What I want is to replace these to:

<div id="body>

and I tried this:

<table border="0" cellpadding="0" cellspacing="0" width="([^\*]|[^/].*?)\3">

But it is not working. It is only searching for table tags which starts with:

<table border="0" cellpadding="0" cellspacing="0" width="

and ends with:

3">

But not the codes mentioned above. Someone please help.
openaccount1Asked:
Who is Participating?
 
Shinesh PremrajanEngineering ManagerCommented:
(<table border="0" cellpadding="0" cellspacing="0" width=")([0-9]{3,4})(">)(.*)
(<tr>)(.*)
(<td colspan="3">)

Hope this helps
0
 
Shinesh PremrajanEngineering ManagerCommented:
I dont know why you have \3 in the regular expression. Just give a try in the below REGEXP.

(<table border="0" cellpadding="0" cellspacing="0" width=")([^\*]|[^/].*?)(">)
0
 
openaccount1Author Commented:
The result it is showing is only this:

<table border="0" cellpadding="0" cellspacing="0" width="1000">

It is not getting the codes down to the <td colspan="3">
0
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.

 
Shinesh PremrajanEngineering ManagerCommented:
(<table border="0" cellpadding="0" cellspacing="0" width=")([0-9]{3,4})(">)(*.*)
(<tr>(*.*)
<td colspan="3">)
0
 
openaccount1Author Commented:
It says:
invalid quantifyer *"
0
 
openaccount1Author Commented:
ok, thanks. I simplified it to this:

<table border="0" cellpadding="0" cellspacing="0" width="(.*)
(.*)
(.*)colspan="3">

However i missed something.

some have the other codes after the width but they are not being added in the search result.

e.g.

<table border="0" cellpadding="0" cellspacing="0" width="1000" font="" face="Verdana, Arial, Helvetica, sans-serif" size="2">
<tr align="left">
<td valign="top" colspan="3">
0
 
openaccount1Author Commented:
Actually everything is ok now so no need to response to my last message.
0
 
openaccount1Author Commented:
This does what I needed to do. Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.