Regular Expression - decimal number positive negative

2012-12-14 Thread Paul Giesenhagen
Heya, I know that some will know this quickly ... but I have ReplaceNoCase(str, [^0-9\.],,ALL) And this takes -5 to 5 ... which is not what I want - I want to include negative numbers what do I add to this regular expression to keep the decimals (if there) and keep the negative if there? So

Re: Regular Expression - decimal number positive negative

2012-12-14 Thread Nathan Strutz
... but I have ReplaceNoCase(str, [^0-9\.],,ALL) And this takes -5 to 5 ... which is not what I want - I want to include negative numbers what do I add to this regular expression to keep the decimals (if there) and keep the negative if there? So 5.24 is fine -5.24 is fine 5 is fine -5 if fine

Re: Regular Expression - decimal number positive negative

2012-12-14 Thread Matt Quackenbush
negative numbers what do I add to this regular expression to keep the decimals (if there) and keep the negative if there? So 5.24 is fine -5.24 is fine 5 is fine -5 if fine $5.24 (replace the $) $5,244.22 (replace the $ and the ,) Basically I need positive and negative

Re: Regular Expression - decimal number positive negative

2012-12-14 Thread Adam Cameron
is not what I want - I want to include negative numbers what do I add to this regular expression to keep the decimals (if there) and keep the negative if there? So 5.24 is fine -5.24 is fine 5 is fine -5 if fine $5.24 (replace the $) $5,244.22 (replace the $ and the ,) Basically I need

RE: Regular Expression - decimal number positive negative

2012-12-14 Thread Paul Giesenhagen
Good deal ... thank you! -Original Message- From: Adam Cameron [mailto:adamcameroncoldfus...@gmail.com] Sent: Friday, December 14, 2012 9:28 AM To: cf-talk Subject: Re: Regular Expression - decimal number positive negative Recommend not reinventing the wheel here: http

Regular Expression Help

2011-06-14 Thread Patrick Kerley
I have a regular expression issue. I have information that says: ~{Test Information/a/li That in a series of processing should look like ~{Test Information}~/a/li   Any idea in a rereplace how I can replace anything that is ~{*/a/li with ~{*}~/a/li Thanks Pat - Patrick Kerley

Re: Regular Expression Help

2011-06-14 Thread Patrick Santora
Information}~/a/li~{Test Information4}~/a/li~{Test Information}~/a/li -Pat On Tue, Jun 14, 2011 at 7:49 AM, Patrick Kerley kerl...@yahoo.com wrote: I have a regular expression issue. I have information that says: ~{Test Information/a/li That in a series of processing should look like

Re: Regular Expression Help

2011-06-14 Thread Patrick Santora
}~/a/li )# / Should show: ~{Test Information2}~/a/li~{Test Information}~/a/li~{Test Information4}~/a/li~{Test Information}~/a/li -Pat On Tue, Jun 14, 2011 at 7:49 AM, Patrick Kerley kerl...@yahoo.com wrote: I have a regular expression issue. I have information that says: ~{Test

Re: Regular Expression Help

2011-06-14 Thread Peter Boughton
Give this a go: cfset Result = InputText.replaceAll ( '~\{(?:(?!/a).)+(?!\}~)(?=/a/li)' , '$0}~' ) / It uses the java replaceAll regex function so that it can do the negative lookbehind to ensure existing correct items are not changed, meaning it can be run

Re: Regular Expression Help

2011-06-14 Thread Patrick Kerley
Sent: Tuesday, June 14, 2011 12:16 PM Subject: Re: Regular Expression Help Give this a go:     cfset Result = InputText.replaceAll         ( '~\{(?:(?!/a).)+(?!\}~)(?=/a/li)'         , '$0}~'         ) / It uses the java replaceAll regex function so that it can do the negative lookbehind

regular expression problem

2009-12-03 Thread Andrew Grosset
I'm trying to build a regular expression that only accepts images from http://pics.mysite.com; (part of an antisamy policy) my expression: ^((http\:\/\/pics\.mysite\.com) + ([a-zA-Z\.]))*$ the intention is to allow http://pics.mysite.com/xxx.jpg; and disallow http://anyOtherSite.com/xxx.jpg

Re: regular expression problem

2009-12-03 Thread Charlie Griefer
how about cfif { var } contains pics.mysite.com ? On Thu, Dec 3, 2009 at 4:55 PM, Andrew Grosset rushg...@yahoo.com wrote: I'm trying to build a regular expression that only accepts images from http://pics.mysite.com; (part of an antisamy policy) my expression: ^((http\:\/\/pics\.mysite

Re: regular expression problem

2009-12-03 Thread Matt Quackenbush
cfif reFindNoCase(\Ahttp://pics\.mysite\.com/.*?\.(gif|jpg|jpeg|png|bmp)\Z,picUrl) EQ 0 // don't allow the pic /cfif There is no reason to escape the : or the / like you've done in your example. Neither of those are special characters.

Re: regular expression problem

2009-12-03 Thread Andrew Grosset
Yes that would work but this is part of an antisamypolicy.xml file that filters all user input - for more info see: Using AntiSamy to protect your CFM pages from XSS hacks http://tinyurl.com/yhl34tn how about cfif { var } contains pics.mysite.com ? On Thu, Dec 3, 2009 at 4:55 PM, Andrew

Re: regular expression problem

2009-12-03 Thread Charlie Griefer
Ah, cool. Didn't know about AntiSamy. Reading up :) On Thu, Dec 3, 2009 at 5:18 PM, Andrew Grosset rushg...@yahoo.com wrote: Yes that would work but this is part of an antisamypolicy.xml file that filters all user input - for more info see: Using AntiSamy to protect your CFM pages from

Re: regular expression problem

2009-12-03 Thread Andrew Grosset
Solved! (http://pics.mysite.com/ + [a-zA-Z\.])* http://pics1.mysite.com/xxx.jpg and http://pics.mysite.com/xxx*.jpg are both rejected and http://pics.mysite.com/xxx.jpg is accepted. Ah, cool. Didn't know about AntiSamy. Reading up :) On Thu, Dec 3, 2009 at 5:18 PM, Andrew Grosset

Regular Expression problem

2009-03-14 Thread Andrew Grosset
I want to allow letters,numbers,_,-,: and $ regexp name=letternumber value= [a-zA-Z0-9\_\-:\%]+/ it returns false with : , slowly pulling my hair out and have exhausted Google - any suggestions? thanks, Andrew. ~| Adobe®

Re: Regular Expression problem

2009-03-14 Thread Matt Quackenbush
[A-Za-z0-9_:%\$-]+ Does that work for ya? Two things that jump out at me: 1) You're escaping several items that don't need escaping, and 2) any time you need to use -, it needs to be the character in the character class (otherwise the regex engine thinks you're trying to define a range) HTH

Re: Regular Expression problem

2009-03-14 Thread Peter Boughton
2) any time you need to use -, it needs to be the character in the You missed the critical word! ;) It needs to be the LAST character in the set. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release

Re: Regular Expression problem

2009-03-14 Thread Matt Quackenbush
Damn wireless keyboards! ;-) On Sat, Mar 14, 2009 at 5:54 AM, Peter Boughton wrote: 2) any time you need to use -, it needs to be the character in the You missed the critical word! ;) It needs to be the LAST character in the set.

Re: Regular Expression problem

2009-03-14 Thread Andrew Grosset
many thanks! I was working on an antisamy script which uses a whitelist to parse user input and this regular expression appeared to be not working, turns out that there appears to be a bug when using style as an inline attribute of a tag such as div or span. Andrew

regular expression to find #

2008-11-19 Thread Mike Wesling
I am trying to make a regular expression to find # .. \ / and % in a string, but I am new to expressions. Anyone have a good link for beginners on doing this? ~| Adobe® ColdFusion® 8 software 8 is the most important

RE: regular expression to find #

2008-11-19 Thread Andy Matthews
the regex to look for each of those chars individually instead of as one string. andy -Original Message- From: Mike Wesling [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2008 9:04 AM To: cf-talk Subject: regular expression to find # I am trying to make a regular expression to find

Re: regular expression to find ##

2008-11-19 Thread Mike Wesling
to make a regular expression to find # .. \ / and % in a string, but I am new to expressions. Anyone have a good link for beginners on doing this? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release

Re: regular expression to find ####

2008-11-19 Thread Jason Fisher
forces the regex to look for each of those chars individually instead of as one string. andy I am trying to make a regular expression to find # .. \ / and % in a string, but I am new to expressions. Anyone have a good link for beginners on doing

Re: regular expression to find ####

2008-11-19 Thread Peter Boughton
I thought you cannot just place a . or \ as they are special characters. The . is not special when used within a character class (the square brackets). i.e. You do *not* need to escape [.] - that will match dot, not 'any character'. I also need to find a double . not a single. A character

Any regular expression guru here?

2008-11-13 Thread Don L
What I'd like to want to do is to replace a value from a simple text which looks like this: a= b=tyweu8939skdksspdssdsd c=sd How do I replace the value of b when the b value is unknown? Thanks. ~| Adobe® ColdFusion® 8

Re: Any regular expression guru here?

2008-11-13 Thread Jerry Johnson
Also try the HOF regex list (which gets monitored by many, although there are few postings) is that a line break before and after the b= line? On Thu, Nov 13, 2008 at 12:11 PM, Don L [EMAIL PROTECTED] wrote: What I'd like to want to do is to replace a value from a simple text which looks

Re: Any regular expression guru here?

2008-11-13 Thread Michael Dinowitz
In the example below, you only want to replace the b while leaving the a and c alone, right? Will the b always have a format of b=tyweu8939skdksspdssdsd. Does tyweu8939skdksspdssdsd have a pattern to it? Is it that the b= values always have 21 characters after it? Point is, what's the pattern

RE: Any regular expression guru here?

2008-11-13 Thread Andy Matthews
[mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2008 11:11 AM To: cf-talk Subject: Any regular expression guru here? What I'd like to want to do is to replace a value from a simple text which looks like this: a= b=tyweu8939skdksspdssdsd c=sd How do I replace the value of b when the b

RE: Any regular expression guru here?

2008-11-13 Thread Adrian Lynch
:11 To: cf-talk Subject: Any regular expression guru here? What I'd like to want to do is to replace a value from a simple text which looks like this: a= b=tyweu8939skdksspdssdsd c=sd How do I replace the value of b when the b value is unknown? Thanks

RE: Any regular expression guru here?

2008-11-13 Thread Andy Matthews
Adrian... The OP said he didn't know in advance what the value of b would be. If he did, yours would work great. -Original Message- From: Adrian Lynch [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2008 11:35 AM To: cf-talk Subject: RE: Any regular expression guru here? Here's

RE: Any regular expression guru here?

2008-11-13 Thread Adrian Lynch
Ah! I think he meant the right side of the equals sign after b. But, if the value (right side of the =) contains 'b=' then we're in trouble again. Adrian -Original Message- From: Andy Matthews Sent: 13 November 2008 17:58 To: cf-talk Subject: RE: Any regular expression guru here

Re: Any regular expression guru here?

2008-11-13 Thread Don L
In the example below, you only want to replace the b while leaving the a and c alone, right? Right. Will the b always have a format of b=tyweu8939skdksspdssdsd. Does tyweu8939skdksspdssdsd have a pattern to it? Not certain, most likely yes. It's the cf8's encrypted password for the admin. Is

Re: Any regular expression guru here?

2008-11-13 Thread Don L
Ah! I think he meant the right side of the equals sign after b. But, if the value (right side of the =) contains 'b=' then we're in trouble again. Yes, exactly, one way (theoritically) would be, have 3 segements for all 3 lines and find the seg2.element[2].value, but I don't know regexp...

RE: Any regular expression guru here?

2008-11-13 Thread brad
Subject: Re: Any regular expression guru here? From: Don L [EMAIL PROTECTED] Date: Thu, November 13, 2008 12:08 pm To: cf-talk cf-talk@houseoffusion.com In the example below, you only want to replace the b while leaving the a and c alone, right? Right. Will the b always have a format of b

Re: Any regular expression guru here?

2008-11-13 Thread Don L
It's the cf8's encrypted password for the admin. Well technically, it's an SHA-1 hash... It sounds like you're basically trying to parse your lib\password.properties file? Perhaps there is another way to accomplish your task through the adminAPI? ~Brad Brad, good thought, just looked at the

Re: Any regular expression guru here?

2008-11-13 Thread Don L
Well, since the objective is to disable cf admin access. Just realized a silly and yet effective way would be to move the CFIDE directory away from web root. I hope it won't adversely impact the cf8 server. What I'd like to want to do is to replace a value from a simple text which looks

Regular Expression help

2008-10-31 Thread Matthew Friedman
Please help, banging my head against a wall and my deadline is up... I need to search a text filed of html formatted text to see if the user enter in bad words I have it all set to go but the regexp is giving me trouble. I am looping over the list of badwords and checking the variable skills.

Re: Regular Expression help

2008-10-31 Thread Jason Fisher
I think you want something like this: cfif REFindnocase(([\s\]#badword#[\s\]),skills) You may want to expand it to non-alphanumeric wrappers, though, to catch punctuation: he gave her a kiss. cfif REFindnocase(([\W]#badword#[\W]),skills) which is the same as cfif

Re: Regular Expression help

2008-10-31 Thread Matthew Friedman
Not sure what I am doing wrong but this is not working. I have the string kissess are goodbrkissbrthe girlfriend Kiss is a badword, and this regexp is not picking it up. Please advise and thanks for your help. Matt I think you want something like this: cfif

Re: Regular Expression help

2008-10-31 Thread Jason Fisher
Hm, that should work, certainly. Did you try that 3rd option? cfif REFindnocase(([^a-zA-Z0-9_]#badword#[^a-zA-Z0-9_]),skills) That should find any use of the word 'kiss' when it's surrounded by any non-alpha characters. Sadly I don't have access to my CF environment right at the moment,

Re: Regular Expression help

2008-10-31 Thread Jason Fisher
Forgot about Ryan Swanson's slick little tool. It certainly validates and picks up the middle 'kiss' in his validator, using either '\W' or '^a-zA-Z0-9_' as the filter: http://ryanswanson.com/regexp/#start ~| Adobe®

Re: Regular Expression help

2008-10-31 Thread Matthew Friedman
Figured out the issue, this works great. Thank you, thank you, thank you ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial

Re: Regular Expression help

2008-10-31 Thread Matthew Friedman
I just found an issue with this regexp cfif REFindnocase(([^a-zA-Z0-9_]#badword#[^a-zA-Z0-9_]),clean_skills) this works great if it is not the first word or only word in the string. what do I need to do to update the regexp to pick up the bad word it is the first last or only word in the

Re: Regular Expression help

2008-10-31 Thread Sonny Savage
Typo: cfif REFindnocase(((^|\W)#badword#(\W|$)),clean_skills) On Fri, Oct 31, 2008 at 1:09 PM, Sonny Savage [EMAIL PROTECTED] wrote: cfif REFindnocase(((^|\W)#badword#(\W|$),clean_skills) On Fri, Oct 31, 2008 at 1:04 PM, Matthew Friedman [EMAIL PROTECTED]wrote: I just found an issue with

Re: Regular Expression help

2008-10-31 Thread Jason Fisher
Good call. Try this, seems to work in initial testing: cfif REFindnocase(((^|[^a-zA-Z0-9_])#badword#([^a-zA-Z0-9_]|$)), clean_skills) I just found an issue with this regexp cfif REFindnocase(([^a-zA-Z0-9_]#badword#[^a-zA-Z0-9_]), clean_skills) this works great if it is not the first

Re: Regular Expression help

2008-10-31 Thread Sonny Savage
cfif REFindnocase(((^|\W)#badword#(\W|$),clean_skills) On Fri, Oct 31, 2008 at 1:04 PM, Matthew Friedman [EMAIL PROTECTED] wrote: I just found an issue with this regexp cfif REFindnocase(([^a-zA-Z0-9_]#badword#[^a-zA-Z0-9_]),clean_skills) this works great if it is not the first word or

Help with Regular expression

2008-04-01 Thread Suresh
Hi all, I am trying to replace April 01 2008 with April 1 2008 or April 02 2008 with April 2 2008, .. This is a start cfset Date = #Replace(#Date#,^[A-Za-z]+,April )# Can anybody help me? Thanks

Re: Help with Regular expression

2008-04-01 Thread Charlie Griefer
On Tue, Apr 1, 2008 at 12:35 PM, Suresh [EMAIL PROTECTED] wrote: I am trying to replace April 01 2008 with April 1 2008 or April 02 2008 with April 2 2008, .. This is a start cfset Date = #Replace(#Date#,^[A-Za-z]+,April )# cfset myDate = April 01 2008 /

Re: Help with Regular expression

2008-04-01 Thread Kris Jones
You'd want to use ReReplace, rather than Replace of course. But probably just formatting it with dateformat() would work: cfset Date = dateformat(date, d ) / Also, don't know if this is still a problem in CF, but be careful about calling variables date... Cheers, Kris I am trying to

RE: Help with Regular expression

2008-04-01 Thread Andy Matthews
You can call them date as long as they're not form field variables. -Original Message- From: Kris Jones [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2008 2:48 PM To: CF-Talk Subject: Re: Help with Regular expression You'd want to use ReReplace, rather than Replace of course

RE: Help with Regular expression

2008-04-01 Thread Dave Francis
or SQL column names... -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2008 3:24 PM To: CF-Talk Subject: RE: Help with Regular expression You can call them date as long as they're not form field variables. -Original Message

Regular Expression To Pull Values From A Commented Area

2008-01-23 Thread Philip Hayes
I need some help with an area of ColdFusion which I would call my Achilles Heal of ColdFusion Programming. I cannot get my mind around Regular Expressions, but know its the solution to many of my problems. For example I have the following CF Comment on a cfm page: !--- Widget Name: My

Re: Regular Expression To Pull Values From A Commented Area

2008-01-23 Thread Claude Schneegans
Is there anybody out there who can help me do this? Sure, there is CF_REextract. It will return all your fields in a list or a query, and even read the file for you. See: http://www.contentbox.com/claude/customtags/REextract/testREextract.cfm

RE: Regular Expression To Pull Values From A Commented Area

2008-01-23 Thread Bobby Hartsfield
starting with the first instance of !--- and ending with the next instance of --- ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Philip Hayes [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 23, 2008 10:53 AM To: CF-Talk Subject: Regular

RE: Regular Expression To Pull Values From A Commented Area

2008-01-23 Thread Bobby Hartsfield
Although it will still work exactly the same, it actually finds everything between the first instance of !--- and -- I used html comments for testing and forgot to change the -- to --- ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com

Re: Regular Expression To Pull Values From A Commented Area

2008-01-23 Thread Philip Hayes
That's pretty cool. i have never seen that tag before. I'll try it. Thanks On Jan 23, 2008, at 11:58 AM, Claude Schneegans wrote: Is there anybody out there who can help me do this? Sure, there is CF_REextract. It will return all your fields in a list or a query, and even read the file for

Re: Regular Expression To Pull Values From A Commented Area

2008-01-23 Thread Sonny Savage
Here's one approach: !--- Comments with fields --- cfset regexComment = !---(.*?)--- cfset regexCommentFields = ^(.*?):(.*)$ cfset fileContent = blah blah!--- Sample Comment ---ya ya !--- Widget Name: My Widget Widget URL: http://siriusinnovations.com Description: This is the description Version:

Re: can't use the result of a regular expression as a variable?

2007-12-04 Thread Cutter (CFRelated)
Yeah, maybe he's looking for something like qryUser[currentrow - 1]? Steve Cutter Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _ http://blog.cutterscrossing.com Michael Dinowitz wrote: The back-reference variables (\1, etc.) can't

RE: can't use the result of a regular expression as a variable?

2007-12-04 Thread Bobby Hartsfield
First, you are not setting the results to a variable Try... cfset THESTRING = reReplace(thestring,'\w*{(\w+)}','#qryUser[\1]#','all')/ But using \1 in a var isn't going to work like that. Youll need 2 lines... cfset THESTRING = reReplace(thestring,'\w*{(\w+)}','\1','all')/ cfset THESTRING =

Re: can't use the result of a regular expression as a variable?

2007-12-04 Thread Ben Doom
CF evaluates the replace string *before* sending it to the regular expression engine. Therefore, it's trying to find the struct key named '\1' which is not legal. There are several ways to get around this, but they all basically boil down to doing it in two steps. --BenD Johnny Le wrote: I

can't use the result of a regular expression as a variable?

2007-12-03 Thread Johnny Le
I tried to do this: cfset thestring = user.listid={id}username={username}/ cfset reReplace(thestring,'\w*{(\w+)}','#qryUser[\1]#','all')/ but I got an error. Is it possible to use \1 as a variable? I even tried '#evaluate(qryUser[\1])# but it doesn't work.

Re: can't use the result of a regular expression as a variable?

2007-12-03 Thread Michael Dinowitz
The back-reference variables (\1, etc.) can't be used as a value of a ColdFusion function within a RE tag. On Dec 3, 2007 10:42 PM, Johnny Le [EMAIL PROTECTED] wrote: I tried to do this: cfset thestring = user.listid={id}username={username}/ cfset

Re: Regular Expression to count links

2007-05-18 Thread Tom Chiverton
On Friday 18 May 2007, K Simanonok wrote: Tom, you may be well-intentioned, but do you realize your posts were useless? A question like Hey buddy, can you tell me where the train station is? is never intended to be taken so literally that yes is a worthwhile answer. You didn't ask 'how do

Re: Regular Expression to count links

2007-05-18 Thread chopper
] Sent: Thursday, May 17, 2007 11:53 PM To: CF-Talk Subject: RE: Regular Expression to count links Actually... the while loop I posted is considerably faster. About 16ms faster. Maybe it's the loop or the cfscript... I dunno

RE: Regular Expression to count links

2007-05-18 Thread Bobby Hartsfield
That may be what I did, can't remember. But... that method worked and was 16 times faster ;-) -Original Message- From: chopper [mailto:[EMAIL PROTECTED] Sent: Friday, May 18, 2007 12:12 PM To: CF-Talk Subject: Re: Regular Expression to count links True about the runaway loop

Re: Regular Expression to count links

2007-05-17 Thread K Simanonok
Thanks Charlie, looks like your solution will work, I'll test. Andy, I appreciate your suggestion even if it won't work. Tom, you may be well-intentioned, but do you realize your posts were useless? A question like Hey buddy, can you tell me where the train station is? is never intended to be

RE: Regular Expression to count links

2007-05-17 Thread Bobby Hartsfield
[mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 9:52 PM To: CF-Talk Subject: Re: Regular Expression to count links Thanks Charlie, looks like your solution will work, I'll test. Andy, I appreciate your suggestion even if it won't work. Tom, you may be well-intentioned, but do you realize

Re: Regular Expression to count links

2007-05-17 Thread chopper
of a 2) remove the instance of a 3) repeat until no more instances of a -Original Message- From: K Simanonok [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 9:52 PM To: CF-Talk Subject: Re: Regular Expression to count links Thanks Charlie, looks like your solution

RE: Regular Expression to count links

2007-05-17 Thread Bobby Hartsfield
Actually... the while loop I posted is considerably faster. About 16ms faster. Maybe it’s the loop or the cfscript... I dunno. -Original Message- From: chopper [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 11:33 PM To: CF-Talk Subject: Re: Regular Expression to count links

RE: Regular Expression to count links

2007-05-17 Thread Bobby Hartsfield
-Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 11:53 PM To: CF-Talk Subject: RE: Regular Expression to count links Actually... the while loop I posted is considerably faster. About 16ms faster. Maybe it’s the loop or the cfscript... I

RE: Regular Expression to count links

2007-05-17 Thread Bobby Hartsfield
That's also a runaway loop when there are no links found ;-) -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 11:53 PM To: CF-Talk Subject: RE: Regular Expression to count links Actually... the while loop I posted is considerably faster

Regular Expression to count links

2007-05-16 Thread K Simanonok
Is it possible to use a regular expression to count the number of links A HREF=http://something.com;like so/A in a given block of text? ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new

Re: Regular Expression to count links

2007-05-16 Thread Tom Chiverton
On Wednesday 16 May 2007, K Simanonok wrote: Is it possible to use a regular expression to count the number of links A HREF=http://something.com;like so/A in a given block of text? Yes, finding matches of a pattern in a block of text is exactly what it is for. -- Tom Chiverton

RE: Regular Expression to count links

2007-05-16 Thread Andy Matthews
To: CF-Talk Subject: Regular Expression to count links Is it possible to use a regular expression to count the number of links A HREF=http://something.com;like so/A in a given block of text? ~| Deploy Web Applications Quickly

Re: Regular Expression to count links

2007-05-16 Thread Tom Chiverton
On Wednesday 16 May 2007, Andy Matthews wrote: cfset hrefCount = ArrayLen(ListToArray(String,href)) I'm not sure that does what you think it does. http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentationfile=0353.htm#3082862 If

Re: Regular Expression to count links

2007-05-16 Thread Charlie Griefer
yeah. can't use multiple character delimiters in CF. Not with native CF array/list functions. if you use split(), you can. cfset myString = a_!_b_!_c_d!e_f / cfset myArray = myString.split('_!_') / cfoutput #listLen(myString, '_!_')# br / #arrayLen(myArray)# /cfoutput

regular expression to match and replace tag set

2007-05-16 Thread Bhasker Konakanchi
I need help with the following search and replace using regular expressions. I am a beginner as far as regular expressions are considered. I am using javascript to execute these regualr expressions. I have a huge HTML in a variable, I would like to remove some tags from it and in some cases

Re: regular expression to match and replace tag set

2007-05-16 Thread Claude Schneegans
I need help with the following search and replace using regular expressions. You could use CF_REExtract (see http://www.contentbox.com/claude/customtags/REextract/testREextract.cfm ) First get all occurences of input tags in a query, then loop in the query, check the presence of string replace

Re: regular expression to match and replace tag set

2007-05-16 Thread Bhasker Konakanchi
Thanks for the reply! I am trying to do this on the client side. Also I want do this whole thing using regex and avoid using loops and comparisons, as the HTML can be huge and I want it to be fast. Any other suggestions. Is it even possible to get what I want using regular expressions?

RE: regular expression to match and replace tag set

2007-05-16 Thread Bobby Hartsfield
.*?class.*?)replace(.*?.*?), \1\2, all) if not, maybe someone can convert those to JS for you. Cheers -Original Message- From: Bhasker Konakanchi [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 16, 2007 1:59 PM To: CF-Talk Subject: regular expression to match and replace tag set I need

Re: regular expression to match and replace tag set

2007-05-16 Thread Bhasker Konakanchi
That is simly great! I have tested the first expression and it worked like a charm. I haven't tested the second one yet, I will post the results once I test it. Thank you very much for your help. -BK I haven?t played with javascript regexes much so I'd personally send it off to be processed

Re: Regular Expression Help on Email Addresses

2007-02-21 Thread Eric Haskins
I am working on a variable mask version as I have time. This one will atleast mask the domain for now. Eric On 2/20/07, Eric Haskins [EMAIL PROTECTED] wrote: cfset email = ReReplaceNocase(email, ([a-zA-Z0-9_\-\.]+)@((([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3}), [EMAIL PROTECTED])/ Try

Re: Regular Expression Help on Email Addresses

2007-02-21 Thread Eric Haskins
cfset variables.domainlen = Len(ReReplaceNocase(attributes.email, ([a-zA-Z0-9_\-\.]+)@((([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3}), \2)) - 1 cfset variables.mask = cfloop from=1 to=#variables.domainlen# index=i cfset variables.mask = variables.mask * /cfloop cfset variables.email =

Regular Expression Help on Email Addresses

2007-02-20 Thread K Simanonok
I would like to use a regular expression to camouflage email addresses in a forum I'm building. I'd like to replace just the domain name (not the .com or .net or other extension though) with x's: FROM THIS: [EMAIL PROTECTED] TO THIS:[EMAIL PROTECTED] Where the number of x's exactly

Regular Expression Help on Email Addresses

2007-02-20 Thread K Simanonok
I would like to use a regular expression to camouflage email addresses in a forum I'm building. I'd like to replace just the domain name (not the .com or .net or other extension though) with x's: FROM THIS: [EMAIL PROTECTED] TO THIS:[EMAIL PROTECTED] Where the number of x's exactly

Re: Regular Expression Help on Email Addresses

2007-02-20 Thread Eric Haskins
cfset email = ReReplaceNocase(email, ([a-zA-Z0-9_\-\.]+)@((([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3}), [EMAIL PROTECTED])/ Try this one Eric On 2/20/07, K Simanonok [EMAIL PROTECTED] wrote: I would like to use a regular expression to camouflage email addresses in a forum I'm building

Regular Expression Help on Email Addresses

2007-02-20 Thread K Simanonok
I would like to use a regular expression to camouflage email addresses in a forum I'm building. I'd like to replace just the domain name (not the .com or .net or other extension though) with x's: FROM THIS: [EMAIL PROTECTED] TO THIS:[EMAIL PROTECTED] Where the number of x's exactly

Re: Regular Expression Help on Email Addresses

2007-02-20 Thread Ben Doom
Simanonok wrote: I would like to use a regular expression to camouflage email addresses in a forum I'm building. I'd like to replace just the domain name (not the .com or .net or other extension though) with x's: FROM THIS: [EMAIL PROTECTED] TO THIS:[EMAIL PROTECTED] Where the number

regular expression - callback function

2007-02-12 Thread Peter Boughton
Hello. Does anyone know how I can implement a regex callback? ie: I have the following code: cfset Content = REReplace(Content,'''cfif \(Var\(([^,]+),([^]+))\) ([A-Z]+) ([^]+\)', '''cfif (Var(\1),\2)) \3 \4', all)/ And I need to run a function on \1, \3 and \4 as they are replaced. I'm fairly

RE: regular expression - callback function

2007-02-12 Thread Ben Nadel
- From: Peter Boughton [mailto:[EMAIL PROTECTED] Sent: Monday, February 12, 2007 10:41 AM To: CF-Talk Subject: regular expression - callback function Hello. Does anyone know how I can implement a regex callback? ie: I have the following code: cfset Content = REReplace(Content,'''cfif \(Var

Re: regular expression - callback function

2007-02-12 Thread Peter Boughton
. . Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Peter Boughton [mailto:[EMAIL PROTECTED] Sent: Monday, February 12, 2007 10:41 AM To: CF-Talk Subject: regular expression

RE: regular expression - callback function

2007-02-12 Thread Ben Nadel
: Peter Boughton [mailto:[EMAIL PROTECTED] Sent: Monday, February 12, 2007 12:21 PM To: CF-Talk Subject: Re: regular expression - callback function Thanks Ben, that's great! :D I did solve my main problem another way, but I should be able to get more elegant code with your method, so I'll have

Regular Expression Help

2007-01-29 Thread Lee.S.Surma
How would you do numbers under one hundred with a limit of 7 decimals? Lee Surma Applications Systems Engineer Wells Fargo Corporate Trust [EMAIL PROTECTED] 612-667-4066 ~| Upgrade to Adobe ColdFusion MX7 Experience

RE: Regular Expression Help

2007-01-29 Thread Ben Nadel
Not really sure what exactly you are looking to do, but the regular expression pattern for numbers under 100 with 7 decimals would be: \d{2}(\.\d{1,7})? This makes the decimal optional (with 1 to 7 decimal places). Of course, this does not protect AGAINST numbers over one hundred. For that you

Re: Regular Expression Help

2007-01-29 Thread Ben Doom
Ben Nadel wrote: Not really sure what exactly you are looking to do, but the regular expression pattern for numbers under 100 with 7 decimals would be: \d{2}(\.\d{1,7})? I'd anchor it, assuming that this is supposed to be the whole string: ^\d{2}(\.\d{1,7})?$ --Ben Doom

RE: Regular Expression Help

2007-01-29 Thread Ben Nadel
: Regular Expression Help Ben Nadel wrote: Not really sure what exactly you are looking to do, but the regular expression pattern for numbers under 100 with 7 decimals would be: \d{2}(\.\d{1,7})? I'd anchor it, assuming that this is supposed to be the whole string: ^\d{2}(\.\d{1,7})?$ --Ben

RE: Regular Expression Help

2007-01-29 Thread Bobby Hartsfield
That would not match 0 through 9.999 unless they were formatted into 2 digit numbers like 00, 01, etc... 09.999 It also wouldn’t match anything between 1 and 0 like .999 unless it was formatted like 00.999 Try this one: ^\d{0,2}(\.\d{1,7})?$ I don’t know what you are using it for

RE: Regular Expression Help....

2007-01-24 Thread Ben Nadel
for 'href' and so on, but the RIGHT regular expression would make sure all possibilities are covered like href=, href=' or href= or href = and so on. Can anyone help please? Thanks! Dave ~| Upgrade to Adobe ColdFusion MX7

  1   2   3   4   5   >