This works for me:

Replace:  #(Form.[[:alnum:]_]+)#
With:     #Trim(\1)#

Of course, if you want it to handle more complex scenarios (Functions,
Structures, etc), you'll have to do a bit of tweaking.

-R

P.S. - Regexs under CF suck!


-----Original Message-----
From: Mark W. Breneman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 09, 2001 12:35
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