Does any one see a need to store an often used reg. exp. snippet in studio
and have the ability to execute it from something like a snippet or button?

I have a regexp pattern that I use for converting plain HTML form fields
into smart form fields. (repopulates the form fields if a required field is
missed in server side validation.  And, uses form data in place of queried
data)   I would love to make a "automated snippet" that would run the regexp
pattern just by clicking on it.

Dose anyone else see a need for this?  Or, should I give up lobbying MM to
add this to studio 6.

Mark W. Breneman
-Macromedia Certified ColdFusion 5 Developer
-Network / Web Server Administrator
  Vivid Media
  [EMAIL PROTECTED]
  www.vividmedia.com
  608.270.9770


-----Original Message-----
From: Andre Turrettini [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 27, 2001 10:18 AM
To: CF-Talk
Subject: RE: More regexp madness


Hi Kay,
this worked ok for me.  Pretty much right off your post.
DRE

<cfset ugly = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">'>
<cfset attributes.bodytext='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.0
Transitional//EN"> helllo hello'>
<cfset attributes.bodytext = replace(attributes.bodytext,
ugly,"","ALL")>

<form>
<textarea cols="50"
rows="6"><CFOUTPUT>#attributes.bodytext#</CFOUTPUT></textarea>
</form>

-----Original Message-----
From: Kay Smoljak [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 27, 2001 9:13 AM
To: CF-Talk
Subject: More regexp madness


Hi all,

I am trying to do what seems like a simple task, but it's just not
playing ball and I have no idea what I am doing wrong.

I have a block of super-ugly ms-marked up text. There is a particular
character sequence I want to get rid of - <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">. Because it has so many
special
chars in it, the only way I could think of getting it into a variable
is
by using CFSAVECONTENT. So, I have this:

<cfsavecontent variable="ugly"><!DOCTYPE HTML PUBLIC "-//W3C//DTD
HTML
4.0 Transitional//EN"></cfsavecontent>

My text block is in a var called #attributes.bodytext#. I then try to
remove the above string like this:
<cfset attributes.bodytext=
replace(attributes.bodytext,"#ugly#","","ALL")>

But when I then output both of these vars (I do it in textareas so it
displays properly in the browser), attributes.bodytext is unchanged.

I have tried replacenocase, rereplace and rereplacenocase, but nothing
is working. If anyone can shed any light I would really appreciate it!

Ta,
K.


______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to