Thanks to everyone. I managed to come up with one similar to Byron's example
and then tweaked it further (No spaces) so I could use it in JS on the
client and CF on the server. I knew I could do it in 2 or three steps but
wanted one step so I could hand off the regex to the client for
Can't really help you with the regex, but regexlib.com might help you with
future ones. I use it whenever I need a regular expressions
-Original Message-
From: UXB [mailto:denn...@uxbinternet.com]
Sent: Monday, July 21, 2014 6:30 PM
To: cf-talk
Subject: Regex help maybe
I am terrible
X{10,20} means that X should exist at least 10 times but no more than 20
times
[0-9] means any single number from 0 till 9
[0-9]{3} means any 3 numbers of 0-9 one after the other
[~!@#$%^*()_+] means a single character from the set of characters defined
between the brackets
Now do you want 3
I need one to test true for:
I doubt you can do this with only one test, but using 3 tests is easy:
10 to 20 Characters in length
3 numeric characters in any order
1 special character from basic list ~!@#$%^*()_+
This should do it:
CFSET stringOK = (len(form.text) GTE 20 AND len(form.text)
This would do one special, 3 consecutive numbers: ajfds123jdfs#
^(?=.*\d{3})(?=.*[\~\!\@\#\$\%\^\\*\(\)\_\+]+).{10,20}$
This would do one special, 3 numbers any position: a#bcdef2k3#4^
^(?=.*\d.*\d.*\d)(?=.*[\~\!\@\#\$\%\^\\*\(\)\_\+]+).{10,20}$
And if your restricting to just numbers and the
FYI I figure it out
was simple once you looked at the content. since it is all in commented tags
ReReplaceNoCase(str,!--(.*?)--, , ALL);
Just incase anyone else has this issue.
I am having an issue creating a regex to strip out the XML content
that Word 2007 is adding our HTML editor.
PM
To: cf-talk
Subject: RE: Regex Help
Sigh...
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message-
From: Andy Matthews [mailto:li...@commadelimited.com]
Sent: Monday, July 26, 2010 3:03 PM
To: cf-talk
Subject: RE: Regex Help
[Completely
be either/or. It must be .
Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged
-Original Message-
From: Michael Grant [mailto:mgr...@modus.bz]
Sent: Monday, July 26, 2010 9:15 PM
To: cf-talk
Subject: Re: Regex Help
I hope he does because your post literally made me
-williams.com/unplugged
-Original Message-
From: Michael Grant [mailto:mgr...@modus.bz]
Sent: Monday, July 26, 2010 9:15 PM
To: cf-talk
Subject: Re: Regex Help
I hope he does because your post literally made me laugh out loud.
On Mon, Jul 26, 2010 at 8:52 PM, andy matthews
li
Why not use url rewrite instead?
What's that? Have a link?
Robert B. Harrison
Director of Interactive Services
Austin Williams
125 Kennedy Drive, Suite 100
Hauppauge NY 11788
P : 631.231.6600 Ext. 119
F : 631.434.7022
http://www.austin-williams.com
Great advertising can't be either/or.
http://en.wikipedia.org/wiki/Rewrite_engine
On Tue, Jul 27, 2010 at 11:17 AM, Robert Harrison
rob...@austin-williams.com wrote:
Why not use url rewrite instead?
What's that? Have a link?
Robert B. Harrison
Director of Interactive Services
Austin Williams
125 Kennedy Drive, Suite
Message-
From: Robert Harrison [mailto:rob...@austin-williams.com]
Sent: Tuesday, July 27, 2010 11:17 AM
To: cf-talk
Subject: RE: Regex Help
Why not use url rewrite instead?
What's that? Have a link?
Robert B. Harrison
Director of Interactive Services
Austin Williams
125 Kennedy Drive, Suite
: Tuesday, July 27, 2010 10:05 AM
To: cf-talk
Subject: Re: Regex Help
Why not use url rewrite instead?
This type of thing is perfect for it, plus none of your existing links will
break.
On Tue, Jul 27, 2010 at 10:55 AM, Robert Harrison
rob...@austin-williams.com wrote:
I knew you were kidding
/ and pass it to index.cfm as
verb=categoryterm=jQuery
andy
-Original Message-
From: Robert Harrison [mailto:rob...@austin-williams.com]
Sent: Tuesday, July 27, 2010 10:24 AM
To: cf-talk
Subject: RE: Regex Help
Why not use url rewrite instead?
If it's this:
http://learn.iis.net/page.aspx
I converting all my URLs from the old variable scheme (i.e., news.cfm?id=7)
to the stupid SEO spoonfeed urls (i.e.,
news.cfm/this-is-my-article-for-stupid-lazy-google-programmers-who-cant-unde
rstand-variables).
I hate this. I now believe Google has supplanted Microsoft as the most evil
Fixing the current links within your site so that they're search engine
safe will actually break ALL of your indexed links within Google, or Yahoo,
etc.
In this case I put in a hook old so the old links still work. They do a 301
redirect to the new link schema. That should cover the search
Robert:
Decided I'd check out your site.
This page is messed up: http://www.austin-williams.com/people/
Barbara Espisito's mini bio is all screwy. (Ironic that she's the copy
chief.)
Looking at the source it looks like your db entry for her is mangled pretty
badly.
On another note, who took
Absolutely... nd I thought it was pretty funny :-)
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message-
From: andy matthews [mailto:li...@commadelimited.com]
Sent: Monday, July 26, 2010 8:52 PM
To: cf-talk
Subject: RE: Regex Help
You know I
Hmmm. Those pages are static and
http://www.austin-williams.com/people/barbara-esposito.cfm looks fine from
here.
What are you seeing? What browser are you on?
As far as the pictures, I'm the Technology Director, not the Creative
Director. That is ground on which I do not tread :-)
Robert
It was on the link I posted. However after going to it again I see it's not
outputting the same as it was. Weird. I'm on chrome. Her text description
was displaying hundreds of little rectangles. Like when character encoding
is improper.
On Tue, Jul 27, 2010 at 12:28 PM, Robert Harrison
This is neither here nor there, but the URLRewriteFilter can go on the
actual application server, thus negating the need for IIS or Apache
intervention, and as an added bonus, can do outbound rules as well.
This means that you don't need to change your internal links from:
rereplace( myvar, '-+', '-', 'all' )
On Mon, Jul 26, 2010 at 10:59 AM, Robert Harrison
rob...@austin-williams.com wrote:
I want to replace any occurrence of multiple -- in string so the entire
string only contains one - in a row after filtering.
Something like this does (sort of):
OT: Isn't regex elegant? Often very cryptic but any solution where I've used
regex seems both sophisticated and simple.
As you were.
~|
Order the Adobe Coldfusion Anthology now!
be .
Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged
-Original Message-
From: Charlie Griefer [mailto:charlie.grie...@gmail.com]
Sent: Monday, July 26, 2010 2:04 PM
To: cf-talk
Subject: Re: Regex Help
rereplace( myvar, '-+', '-', 'all' )
On Mon, Jul 26, 2010
http://www.cftagstore.com/tags/cfreextract.cfm
:)
-Original Message-
From: Robert Harrison [mailto:rob...@austin-williams.com]
Sent: Monday, July 26, 2010 1:00 PM
To: cf-talk
Subject: Regex Help
I want to replace any occurrence of multiple -- in string so the entire
string only
troublemaker :D
On Mon, Jul 26, 2010 at 12:02 PM, Andy Matthews li...@commadelimited.comwrote:
http://www.cftagstore.com/tags/cfreextract.cfm
:)
-Original Message-
From: Robert Harrison [mailto:rob...@austin-williams.com]
Sent: Monday, July 26, 2010 1:00 PM
To: cf-talk
Sigh...
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message-
From: Andy Matthews [mailto:li...@commadelimited.com]
Sent: Monday, July 26, 2010 3:03 PM
To: cf-talk
Subject: RE: Regex Help
[Completely irrelevant link removed]
:)
-Original
You know I was kidding right?
-Original Message-
From: Bobby Hartsfield [mailto:bo...@acoderslife.com]
Sent: Monday, July 26, 2010 6:21 PM
To: cf-talk
Subject: RE: Regex Help
Sigh...
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message
Subject: RE: Regex Help
Sigh...
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message-
From: Andy Matthews [mailto:li...@commadelimited.com]
Sent: Monday, July 26, 2010 3:03 PM
To: cf-talk
Subject: RE: Regex Help
[Completely irrelevant link
: Monday, June 07, 2010 4:27 PM
To: cf-talk
Subject: RE: RegEx help
Assuming that those are tabs between the elements, the following will
expand on Andy's suggestion.
cfset testString = Case Information Problem:diff breathing Patients:1
Four commandment
Information Age:2 months
-
From: Debbie Morris [mailto:dmor...@sussexcountyde.gov]
Sent: Tuesday, June 08, 2010 10:23 AM
To: cf-talk
Subject: RE: RegEx help
Thanks for the help, Jason and Andy. Turns out the character apparently
isn't a tab though. Viewing it in WireShark, it looks like there is a
carriage return (0d
://acoderslife.com
-Original Message-
From: Debbie Morris [mailto:dmor...@sussexcountyde.gov]
Sent: Tuesday, June 08, 2010 10:23 AM
To: cf-talk
Subject: RE: RegEx help
Thanks for the help, Jason and Andy. Turns out the character apparently
isn't a tab though. Viewing it in WireShark
Oh. I never saw mention of that... and I think it's a she ;-)
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message-
From: Michael Grant [mailto:mgr...@modus.bz]
Sent: Tuesday, June 08, 2010 11:06 AM
To: cf-talk
Subject: Re: RegEx help
I think he
;-)
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message-
From: Michael Grant [mailto:mgr...@modus.bz]
Sent: Tuesday, June 08, 2010 11:06 AM
To: cf-talk
Subject: Re: RegEx help
I think he wants to make it part of the t-sql code.
Do you really need
How about something like this:
cfset arFound =
refindnocase(Age:([^\r\n|\r|\n]*)[\r\n|\r|\n],thestring,1,true) /
cfoutput#mid(thestring,arFound[pos][1],arFound[len][1])#/cfoutput
Cheers,
Kris
~|
Order the Adobe Coldfusion
Rather, that would be, if you don't want the label of the field:
cfoutput#mid(thestring,arFound[pos][2],arFound[len][2])#/cfoutput
Cheers,
Kris
On Tue, Jun 8, 2010 at 11:43 AM, Kris Jones kris.jon...@verizon.net wrote:
How about something like this:
cfset arFound =
08, 2010 10:24 AM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: RegEx help
Thanks for the help, Jason and Andy. Turns out the character apparently
isn't a tab though. Viewing it in WireShark, it looks like there is a
carriage return (0d), a line feed (0a) and a space (20) between the age
Fisher [mailto:ja...@wanax.com]
Sent: Tuesday, June 08, 2010 11:40 AM
To: cf-talk
Subject: RE: RegEx help
Debbie,
Where 'testString' is your content, try this:
cfset test = reFind(Age:([0-9a-zA-Z ]+)\s*\n, testString, 1, true) /
cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput
Fisher [mailto:ja...@wanax.com]
Sent: Tuesday, June 08, 2010 11:40 AM
To: cf-talk
Subject: RE: RegEx help
Debbie,
Where 'testString' is your content, try this:
cfset test = reFind(Age:([0-9a-zA-Z ]+)\s*\n, testString, 1, true) /
cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput
If you can always depend on Age: before the desired string, and what looks
like a tab afterwards, then it's trivial:
Age:[0-9a-Z]+\t
That assumes that the age will be any combination of letters and numbers,
and also allows for upper and lower case.
andy
-Original Message-
From:
-Z ]+)\t, testString, 1, true) /
cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput
From: Andy Matthews li...@commadelimited.com
Sent: Monday, June 07, 2010 3:32 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: RegEx help
If you can always
I have no control over this code
The only time parsing HTML with RegEx might be remotely viable is when you know
what that code will be - if the HTML is uncontrolled then using RegEx is a
futile effort.
RegEx is for dealing with Regular text, and HTML is not a Regular language -
even
List wrote at 17 November 2009 14:32:
Andy matthews, you're welcome.
Ah hah, that's a name I'm more familiar with.
testing
Roger. And excuse the previously poorly formatted code (it looked ok at
my end before sending but occasionally in Outlook 2007 when I copy and
paste from external apps
Peter Boughton wrote on Wed 18/11/2009 at 03:12:
The only time parsing HTML with RegEx might be remotely viable is when
you know
what that code will be - if the HTML is uncontrolled then using RegEx
is a futile effort.
RegEx is for dealing with Regular text, and HTML is not a Regular
Azadi Saryev wrote on 16 November 2009 at 17:58
you can do it with something like this:
cfset line='trtd class=la href=/blah.com/atd31
622td25
623td193 645td840 642td1.9 GB'
cfset cleanline = rereplace(line, 't[^]+', '|', 'all')
cfoutput#listfirst(cleanline, '|')# #listlast(cleanline,
Andy matthews, you're welcome.
-Original Message-
From: Mark Henderson [mailto:m...@cwc.co.nz]
Sent: Monday, November 16, 2009 4:29 PM
To: cf-talk
Subject: RE: Regex help with invalid HTML
Azadi Saryev wrote on 16 November 2009 at 17:58
you can do it with something like
testing
-Original Message-
From: Mark Henderson [mailto:m...@cwc.co.nz]
Sent: Monday, November 16, 2009 4:29 PM
To: cf-talk
Subject: RE: Regex help with invalid HTML
Azadi Saryev wrote on 16 November 2009 at 17:58
you can do it with something like this:
cfset line='trtd class=la
Will it always be a domain name you want to keep? And will the file size
always be at the very end of the line?
-Original Message-
From: Mark Henderson [mailto:m...@cwc.co.nz]
Sent: Sunday, November 15, 2009 8:38 PM
To: cf-talk
Subject: Regex help with invalid HTML
Calling all regex
lists wrote:
Will it always be a domain name you want to keep? And will the file
size
always be at the very end of the line?
Yes, and yes (confirmed all the TRs start on a new line).
Regards
Mark
~|
Want to reach the
you can do it with something like this:
cfset line='trtd class=la href=/blah.com/atd31 622td25
623td193 645td840 642td1.9 GB'
cfset cleanline = rereplace(line, 't[^]+', '|', 'all')
cfoutput#listfirst(cleanline, '|')# #listlast(cleanline, '|')#/cfoutput
and if you do not want any html in final
The easiest to read solution is one line:
cfset finalDescription = fiddleWithParas(form.description) /
Of course, that function will then contain a nicely spaced easy-to-read piece
of logic, which almost certainly wont be a horrible single line of nested
replaces.
I'm not an expert with Regex, but you could do this:
cfset finalDescription =
replace(replace(replace(trim(form.description),br,br/,all),p/p
,br /br /,all),p,br /br /,all)
Again, this is not regex, but it is a much more simplified (and faster I
believe) way of doing the same thing with 1 line
less lines != simplified :)
A year from now, which version are you going to want to come back to when it
needs work? The 3 line version or the 1?
I'd prefer the 3. Easier to read.
Not really sure a regex solution is warranted here. You could probably get
one whipped up to find all instances
accepta a list of chars and then replace any of
them when a match was found.
-Original Message-
From: Charlie Griefer [mailto:charlie.grie...@gmail.com]
Sent: Thursday, August 13, 2009 2:29 PM
To: cf-talk
Subject: Re: Regex Help - Can this be simplified?
less lines != simplified :)
A year
: Re: Regex Help - Can this be simplified?
less lines != simplified :)
A year from now, which version are you going to want to come back to when it
needs work? The 3 line version or the 1?
I'd prefer the 3. Easier to read
rereplace(string,(p)+(/p),br,all)
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
: Charlie Griefer [mailto:charlie.grie...@gmail.com]
Sent: Thursday, August 13, 2009 1:29 PM
To: cf-talk
Subject: Re: Regex Help - Can this be simplified?
less lines != simplified :)
A year from now, which version are you going to want to come back to when
it
needs work? The 3 line version
Sorry I didn't read the post very well
rereplace(form.description,(p)+(/p)+(br),br/,all)
This does not replace a single p with br/br/ but I think it does the job.
~|
Want to reach the ColdFusion community with something
There ya go. :) Just found out you can use the pipe | as well.
-Original Message-
From: Tony Bentley [mailto:t...@tonybentley.com]
Sent: Thursday, August 13, 2009 2:35 PM
To: cf-talk
Subject: Re: Regex Help - Can this be simplified?
rereplace(string,(p)+(/p),br,all
You're better off using regex-replace(){rereplace()} over replace() for more
than one condition. The pipe is a way to cheat the replace function but for
future string searching or replacing functions, try regex and you can even test
it online here:
frequently, they're rarely easy to descipher
at a glance.
Gabriel
-Original Message-
From: Tony Bentley [mailto:t...@tonybentley.com]
Sent: Friday, 14 August 2009 5:59 AM
To: cf-talk
Subject: Re: Regex Help - Can this be simplified?
You're better off using regex-replace(){rereplace
How about load jquery and do
jQuery(a).click(function() {
logme(jQuery(this).attr(href));
});
On Thu, Jul 23, 2009 at 2:04 PM, Duane Boudreaudu...@sandybay.com wrote:
I need a little quick (hopefully) regex help.
I have to modify all the links on a site that do not contain onclick events
Message-
From: Barney Boisvert [mailto:bboisv...@gmail.com]
Sent: Thursday, July 23, 2009 6:14 PM
To: cf-talk
Subject: Re: RegEx Help
How about load jquery and do
jQuery(a).click(function() {
logme(jQuery(this).attr(href));
});
On Thu, Jul 23, 2009 at 2:04 PM, Duane Boudreaudu
Hi,
For this type of parsing, you should have a look at CF_REextract:
http://customtags.internetique.com/REextract/testREextract.cfm
~|
Want to reach the ColdFusion community with something they want? Let them know
on the
Tom, you could try this...
cfhttp url=http://www.somedomain.com; method=GET result=theData
cfset allURLs = reMatchNoCase(a([^]*[^/]?),
trim(theData.fileContent))
cfdump var=#allURLs#
-Original Message-
From: Tom Jones [mailto:tjo...@acworld.com]
Sent: Friday, May 29, 2009 11:03 AM
To:
On Friday 29 May 2009, Tom Jones wrote:
If I use the following regular expression in a script it works fine, I just
dont know with CF, I have not used much RE in CF yet.
http://txt2re.com/
--
Helping to globally grow world-class 24/7 unique partnerships as part of the
IT team of the year,
I'm trying to use REFind to get all of the anchor/href tags but I'm
coming up short.
RegEx is not necessarily the ideal tool for this - try a DOM Parser.
If you've got consistent/controlled input you can use regex, and here's a Java
one that will work in most situations:
so like
b[\w]+\.[\...@[\w]+\.[\w]{2,5}/b
That's really basic, but should be easy to understand.
nathan strutz
[Blog and Family @ http://www.dopefly.com/]
[AZCFUG Manager @ http://www.azcfug.org/]
On Fri, Jan 30, 2009 at 9:08 AM, Dean Lawrence dean...@gmail.com wrote:
Hi All,
Can
Try this:
cfset string = this is bfirstname.lastname...@email.com/b email
address /
cfset email =
refindNoCase((b)(([A-Z0-9_%+-]*\.)+[a-z0-9_%+...@[a-z0-9.-]+\.[a-z]{2,4})(\/b),
string, 1, true )/
cfdump var=#mid( string, email.POS[3], email.LEN[3] )#
On Fri, Jan 30, 2009 at 8:08 AM, Dean
This pattern should account for strong as well now:
cfset email =
refindNoCase((b|strong)(([A-Z0-9_%+-]*\.)+[a-z0-9_%+...@[a-z0-9.-]+\.[a-z]{2,4})(\/b|\/strong),
string, 1, true )/
Just amend the tag you want to wrap around the email (b|strong) and
(\/b|\/strong) as shown above. Pipes are the or
Pat,
Few tips.
If you're going to say b or strong with (b|strong), it's a few less
chars to just do (b|strong).
Instead of [a-zA-Z0-9_%+-], you can get by with [\w%+-], oh, and add a
period to one of those in case there is more than 1 in the string, then
there's no need for that extra param and
Thanks for the tips. Always helpful! I built this quickly as I only had a
few minutes. I've worked with regex for a bit.
Either way it looks as though any of these examples will work.
Thanks,
-Pat
On Fri, Jan 30, 2009 at 3:49 PM, Nathan Strutz str...@gmail.com wrote:
Pat,
Few tips.
If
Ok, firstly a slight semantics rant:
Strong and Bold are NOT synonymous - just because the default styling for the
Strong tag is bold does not mean that they are interchangeable.
Now that's out of the way, onto the regex side of things - your pattern will
match this:
reFindNoCase runs a fair amount slower than reFind.
Have you compared it against using inline case-insensitive flag, i.e:
refind( '(?i)regex' , text )
Would be interesting to know if that is any faster/slower than refindnocase.
Any reason not to be using the XHTML parsers out there on the produced output?
Dominic
2008/12/3 Will Tomlinson [EMAIL PROTECTED]:
I guess it'd be cool if I were to use (meta|input|img) in there, to flag
single tags without the trailing [space]/
Will
NVM, of course there is eh, you can auto fix them with CF right...
Dominic
2008/12/3 Dominic Watson [EMAIL PROTECTED]:
Any reason not to be using the XHTML parsers out there on the produced output?
Dominic
2008/12/3 Will Tomlinson [EMAIL PROTECTED]:
I guess it'd be cool if I were to use
/#h-4.6
It is however a good idea to put a space before the / for readability.
andy
-Original Message-
From: Will Tomlinson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 02, 2008 10:07 PM
To: cf-talk
Subject: Re: Regex help - matching invalid xhtml
I guess it'd be cool if I were
Actually, both of your examples are invalid according to the W3C which
states that all attributes must be quoted:
http://www.w3.org/TR/2002/REC-xhtml1-20020801/#h-4.4
The value of that variable output DOES contain quotes. I just need my regex to
do what is required by my company.
Well, I need
Gotcha.
:)
-Original Message-
From: Will Tomlinson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2008 9:04 AM
To: cf-talk
Subject: Re: Regex help - matching invalid xhtml
Actually, both of your examples are invalid according to the W3C
which states that all attributes must
I guess it'd be cool if I were to use (meta|input|img) in there, to flag single
tags without the trailing [space]/
Will
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
I can do just one part, but if I try to make it an either/or with a pipe, it
throws me off. This works.
cfset str = 'if (someKey in struct){'
cfset re = 'if\s+\('
cfoutput#reFindNoCase(re, str)#/cfoutput
How do I add the brackets and so it'll catch one or the other?
Thanks much,
Will
This RegEx will tell you if there are any spaces between the parenthesis:
if\s*\(.*\s+.*\)\s*\{
Edward A Savage Jr - Sonny
Senior Software Engineer
Creditdiscovery, LLC
An appeaser is one who feeds a crocodile, hoping it will eat him last. ~
Sir Winston Churchill
On Mon, Jun 30, 2008 at 2:58 PM,
Ok, my example was wrong anyway. lol!
I figured it out. This worked:
cfset str = 'if(someVar gt 0){'
cfset re = 'if\s+\(|\)\s+\{'
cfoutput#reFindNoCase(re, str)#/cfoutput
~|
Adobe® ColdFusion® 8 software 8 is the most
It just occurred to me that the any pattern matches should be non-greedy for
matching accuracy:
if\s*\(.*?\s+.*?\)\s*\{
On Mon, Jun 30, 2008 at 3:10 PM, Sonny Savage [EMAIL PROTECTED] wrote:
This RegEx will tell you if there are any spaces between the parenthesis:
if\s*\(.*\s+.*\)\s*\{
This RegEx will tell you if there are any spaces between the parenthesis:
if\s*\(.*\s+.*\)\s*\{
I posted a solved post but don't see it yet.
I can't use * because that flags it even if there's 0 spaces. I used + and it
works.
Thanks sonny!
Will
Yeah... my solution has a '+' match on the space. Glad you solved it!
On Mon, Jun 30, 2008 at 3:20 PM, Will Tomlinson [EMAIL PROTECTED] wrote:
This RegEx will tell you if there are any spaces between the parenthesis:
if\s*\(.*\s+.*\)\s*\{
I posted a solved post but don't see it yet.
I
Thank you Jason, Craig and Bobby for your help which is greatly appreciated.
However this is not quite what I want. I do apologise for changing my original
requirement.
I'll try to explain.
I want to read the contents of all the .cfm files in a directory and return all
the href tags with the
Actually, please ignore my last message. I have got it to work:
reFindNoCase(a[ ][\w -~]+productID=[ -~]+/a,inputString, pos)
Thank you everybdoy for your help.
Regards,
cfcoder
Thank you Jason, Craig and Bobby for your help which is greatly
appreciated. However this is not quite what I
Two questions:
1) What does the -~ do inside the []? I haven't seen that syntax before or I'm
incredibly rusty with my regex.
2) Is your regex minimally matching? I had always thought CF was a greedy match?
Thanks,
Jeff
Actually, please ignore my last message. I have got it to work:
That range matches all the characters in the ascii chart except the control
characters. Same as saying give me all the Ascii characters from Ascii 32
(space) to Ascii 126 (_). I thought it was a bit more restrictive than the
dot operator.
In the [\w -~], the -w is actually redundant since
LOL! And here I was thinking the ~ was some kind of special character!
Sometimes if it looks like a tilde it's just a tilde :)
Thanks!
That range matches all the characters in the ascii chart except the control
characters. Same as saying give me all the Ascii characters from Ascii 32
(space)
If you don't manage to get what you're after. Just loop over the array and
look for the string.
Adrian
-Original Message-
From: cf coder
Sent: 15 February 2008 17:11
To: CF-Talk
Subject: regex help
Hello everybody,
I need some help with regular expressions.
I'm trying to write a
pardon me saying this but it looks very complicated. I rather just write a
regex that will do this effortlessley.
Regards,
cfcoder
I need some help with regular expressions.
What you need is the kind of requirement I made CF_REextract for.
See
If tmp 0, it's there!
reFindNoCase(a[ ]+href[ -~]+productID[ -~]+/a,inputString, pos)
Warren Koch
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
Sorry -- you only wanted it if productid was in a query string.
Try this
reFindNoCase(a[ ]+href[ -~]+\?[ -~]+productID=[ -~]+/a,inputString,
pos)
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release
I use the QuickREx plugin for Eclipes. Very handy. RegEx's make my brain
hurt.
http://www.bastian-bergerhoff.com/eclipse/features/web/QuickREx/toc.html
There is a stand alone version
http://www.bastian-bergerhoff.com/eclipse/features/web/QuickREx/standalone.html
--
All you need in this
EDIT:
The regex should be this one instead. The one above would not handle any thing
between the href= and the closing .
(a[^]*href=['](([^']*)?([^']ProductID=?([^']*)[^']*))['][^]*([^]*)\/a)
~|
Adobe® ColdFusion® 8
Hi here is a regex that should do the job. It does a little more that you are
asking for. I felt like playing around with the regex.
cfsavecontent
variable=regex(a[^]*href=['](([^']*)?([^']ProductID=?([^']*)[^']*))[']([^]*)\/a)/cfsavecontent
cfsavecontent variable=text
a style=mystyle:as;
I would prefer the regular expression to do this. Can you show me how to do
what you are suggesting please?
If you don't manage to get what you're after. Just loop over the array and
look for the string.
Adrian
Hello everybody,
I need some help with regular expressions.
I'm trying to write a
I need some help with regular expressions.
What you need is the kind of requirement I made CF_REextract for.
See http://www.contentbox.com/claude/customtags/REextract/testREextract.cfm
~|
Adobe® ColdFusion® 8 software 8 is the
1 - 100 of 444 matches
Mail list logo