HighDots Forums  

Using regular expressions

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Using regular expressions in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Eduardo Cisneros
 
Posts: n/a

Default Using regular expressions - 10-01-2004 , 02:49 PM






Hello:
My issue is this.
I have a big site (more than 1,500 pages) using this format for the li tag:

<li class="normal">You must wash the part every single day.</li>
<li class="normal">Also you must try to....</li>

The thing is to translate to this:

<li class="cielotitulo"><span class="normal">You must wash the part every
single day.</span></li>
<li class="cielotitulo"><span class="normal">Also you must try
to...</span></li>

is easy using this regular expretions query
(<li class=")(normal)(">)(.+)(</li>)

but if you have the li with a line feed ON THE SOURCE CODE
<li class="normal">You must wash the
part every single day.</li>
it canīt read it.

I tried to use the several params to linefeed \s, \b, \w but i canīt get the
code.

Any help please?



Reply With Quote
  #2  
Old   
darrel
 
Posts: n/a

Default Re: Using regular expressions - 10-01-2004 , 03:42 PM






Quote:
li class="normal">You must wash the part every single day.</li
li class="normal">Also you must try to....</li
First of all, why bother with a 'normal' class name? If it's the normal
style, just make that the default style for LI

Quote:
li class="cielotitulo"><span class="normal">You must wash the part every
single day.</span></li
Also, you might be able to get away with:

<li class="cielotitulo normal">

Which would obviously be easier to search and replace against.

Quote:
is easy using this regular expretions query
(<li class=")(normal)(">)(.+)(</li>)

but if you have the li with a line feed ON THE SOURCE CODE
li class="normal">You must wash the
part every single day.</li
it canīt read it.
Try this:
(<li class=")(normal)(">)((.|\n)+)(</li>)

((.|\n)+) = one or more of any character or line break

-Darrel

-Darrel




Reply With Quote
  #3  
Old   
David Stiller
 
Posts: n/a

Default Re: Using regular expressions - 10-01-2004 , 04:03 PM



That's a good answer, Darrel. It's a shame DW doesn't make the multiple
and single line switches available. I've needed them more than once! DW
seems to use these switches internally, given how well the Text (Advanced)
option works (I'm assuming these are essentially regex templates). Ah,
well.


David
stiller ( at ) quip ( dot ) net



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.