On Thu, 6 Jan 2005 127.0.0.1.RemoveThis@127.0.0.1 wrote:
> Just getting to grips with Regular expressions on dreamweaver.
>
> I it possible to do the following, search for:
>
> subjectX.htm
>
> &
>
> replace it with
>
> newtopicX.htm
>
> Where X is a digit 1-100 - which is bascially the page number.
>
> I did the following regular expression:
>
> subject\d\.htm
>
> which works but how do I get it to replace it with:
That should find "subject0.htm", "subject1.htm", "subject2.htm",
"subject3.htm", "subject4.htm", "subject5.htm", "subject6.htm",
"subject7.htm", "subject8.htm" and "subject9.htm" but not
"subject10.htm" to "subject999.htm". You're only looking for
one digit. \d+ would look for any number of digits and \d{1,3}
would look for one to three digits.
>
> newtopicX.htm
>
> Where X is the page number from before ?
With Regular Expressions selected, try searching for:
subject(\d+)\.htm
^^^^^ <------------ subexpression # 1 (one or more digits)
and replacing it with:
newtopic$1.htm
^^ <-------------- uses contents of subexpression # 1.
References that might help:
<a style='text-decoration: underline;' href="http://livedocs.macromedia.com/dreamweaver/mx2004/using/22_codi9.htm" target="_blank">http://livedocs.macromedia.com/dreamweaver/mx2004/using/22_codi9.htm</a>
<a style='text-decoration: underline;' href="http://www.bu.edu/webcentral/learning/dreamweaver2/findandreplace-expressions.html" target="_blank">http://www.bu.edu/webcentral/learning/dreamweaver2/findandreplace-expr...ions.ht</a>
Norman "who admits he knows *nothing* about Dreamweaver but
can often get very lucky using search engines" De Forest
--
Norman De Forest <a style='text-decoration: underline;' href="http://www.chebucto.ns.ca/~af380/Profile.html" target="_blank">http://www.chebucto.ns.ca/~af380/Profile.html</a>
af380.RemoveThis@chebucto.ns.ca [=||=] (A Speech Friendly Site)
"O'Reilly is to a system administrator as a shoulder length latex glove
is to a veterinarian." -- Peter da Silva in the scary devil monastery<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: Dreamweaver & Reg Expressions