|
Hey all -
I am currently re-structuring and re-writing much
of an application to optimize it. This of course involves going
through over 200+ files.
To help ease the blow, I wrote a little RE to take
care of converting concurrent <cfset> statements to <cfscript> for
me using the extended search and replace in studio. Make sure you have the
checkbox "Regular Expressions" checked.
PLEASE backup your files.
First run the following to encase multiple
<cfset> statements in a row with a <cfscript></cfscript> tag
:
Replace :
((([[:space:]]*)(\<cfset)([^>]*)(\>)*([[:space:]]*))+)
With :
<cfscript>\1</cfscript>
Next run the following to convert <cfset>
statements to a format that is friendly to cfscript.
Replace :
(\<cfset)([^>]*)(\>)*
With :
\2; PLEASE backup your files. You cannot
undo search and replace in studio after you have executed it. I haven't
found any problems with it yet, but that doesn't mean it can't
happen. =D
Hope it helps . . . ;)
Nate Nielsen
817.726.8644
Fuse your server and client syntax together
!
|
