Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dreamweaver Find & Replace

Status
Not open for further replies.

alexjamesbrown

Programmer
Mar 7, 2007
8
GB
Hi,
im currently scaling up an asp application from access to SQL Server...

one of the things i need to do is convert things like:

IsDate(CertSignSentDate)

to sql server compliant:

IsDate(CertSignSentDate) = 1

I need to run a regular expression search and replace on the IsDate([]) and make it so it replaces it with IsDate([]) = 1

obviously, the bracketed value must remain the same.

any ideas?
 
Use a regex "lookahead"

search pattern [COLOR=red yellow]\)(?!isdate\()[/color]

will match a ")" that follows "isdate("

then a replace pattern of [COLOR=red yellow]) = 1[/color]

or you can use the DW XML, which is
Code:
<?xml version="1.0"?>
<dwquery>
  <queryparams matchcase="false" ignorewhitespace="false" useregexp="true"/>
  <find>
    <qtext qname="\)(?!isdate\()" qraw="true"></qtext>
  </find>
  <replace action="replaceText" param1=") = 1" param2=""/>
</dwquery>

Save as a .dwr then open it with the DW Find & Replace

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top