Mark,

Here's what you can do.  Open up your copy of ColdFusion Studio and open
a document where you want to make this replacement.  Once you have it
open, press "CTRL+SHIFT+R" (extend search and replace).  When the dialog
box comes up, follow these steps:

1.  Enter the following in the "Find What:" box:
        #(form\.[^#]*)#
2.  Enter the following in the "Replace With:" box:
        #trim(\1)#
3.  Make sure the "Match case" box is NOT checked
4.  Make sure the "Regular expressions" box is checked
5.  Make sure "Current document" is selected for "Find where:"

I would recommend doing this on a few single files first in order to
ensure reliability before doing a mass search and replace on your entire
site.  :)

Good luck.  Hope this helps.

-Tyson

-----Original Message-----
From: Mark W. Breneman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 09, 2001 11:35 AM
To: CF-Talk
Subject: CF Studio: Can Regular expression replace form.* ?


I need a way to do a replace on text that has a known prefix but an
unknown
ending and an unknown length.

An example of this would be to wrap functions around existing form input
value.

I need wrap all my input values with trim()
Each variable has a attribute "form."

Input values:
<input type="text" name="FirstName" value="#Form.FirstName#">
<input type="text" name="LastName" value="#Form.LastName#">
<input type="text" name="Address" value="#Form.Address#">

I need it to look like:
<input type="text" name="FirstName" value="#Trim(Form.FirstName)#">
<input type="text" name="LastName" value="#Trim(Form.LastName)#">
<input type="text" name="Address" value="#Trim(Form.Address#)">

Anyone know if this is possible?

Thanks
Mark W. Breneman
-Cold Fusion Developer
-Network Administrator
  Vivid Media
  [EMAIL PROTECTED]
  www.vividmedia.com
  608.270.9770
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to