: RegEx - help
Anyone got a RegEx to strip out certain HTML tags (and content between
them). I have a working StripHTML UDF now but I require one which
can
say
remove this in its entirety:
select name=foo
option value=pingpong/option
/select
Any RegEx gurus out there switched on today
select[^]+
[^] anything not like
David Manriquez Desarrollador
[EMAIL PROTECTED]
(+56-2) 43 00 155
-Mensaje original-
De: Pascal Peters [mailto:[EMAIL PROTECTED]
Enviado el: Jueves, 14 de Abril de 2005 7:11
Para: CF-Talk
Asunto: RE: RegEx - help
REReplaceNoCase
Replace the Mid() by
RemoveChars(qs, stuff.pos[1], stuff.len[1])
And it should work
Pascal
-Original Message-
From: Jim McAtee [mailto:[EMAIL PROTECTED]
Sent: 13 April 2005 03:01
To: CF-Talk
Subject: Regex help
(CF5 on IIS, Win2k Server)
I have a CF template set up
INFO4: file.cfm
!--- END OUTPUT ---
-Original Message-
From: Jim McAtee [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 12, 2005 9:01 PM
To: CF-Talk
Subject: Regex help
(CF5 on IIS, Win2k Server)
I have a CF template set up as the IIS 404 error handler on a web site.
When IIS detects
Wow ... that didnt come in like I typed it.. sorry it was all jumbled
-Original Message-
From: Ewok [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 13, 2005 9:49 AM
To: CF-Talk
Subject: RE: Regex help
cfset urltext = http://somesite.com/dir/file.cfm?var=value; /
cfset info1 = listrest
(CF5 on IIS, Win2k Server)
I have a CF template set up as the IIS 404 error handler on a web site.
When IIS detects a 404 error it calls the CF page and passes the original
request within the CGI variable cgi.query_string in the following form:
404;http://www.mydomain.com/missingpage.htm
or
Senior Web Systems Engineer
http://www.webassociates.com
-Original Message-
From: Jim McAtee [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 13 April 2005 11:01 AM
To: CF-Talk
Subject: Regex help
(CF5 on IIS, Win2k Server)
I have a CF template set up as the IIS 404 error handler on a web site
Engineer
http://www.webassociates.com
-Original Message-
From: Jim McAtee [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 13 April 2005 11:01 AM
To: CF-Talk
Subject: Regex help
(CF5 on IIS, Win2k Server)
I have a CF template set up as the IIS 404 error handler on a web site.
When IIS
PROTECTED]
Sent: 22 March 2005 22:59
To: CF-Talk
Subject: RE: regex help for grabbing values of html tag attributes
Ben,
I can see what you've got (I think) and it makes sense, but for some
reason, it's not working. I'm grabbing the html from www.google.com
and
running
PROTECTED]
Sent: 22 March 2005 22:59
To: CF-Talk
Subject: RE: regex help for grabbing values of html tag attributes
Ben,
I can see what you've got (I think) and it makes sense, but for some
reason, it's not working. I'm grabbing the html from www.google.com
and
running
Does anyone have a regex already written (or would any of you regex
gurus like you put something up) that could take the source code of an
HTML file and grab the value of an attribute given the tag and the
attribute that would be grabbed. For instance, if I wanted to get the
value of any classes
What version of CF?
--Ben
Burns, John D wrote:
Does anyone have a regex already written (or would any of you regex
gurus like you put something up) that could take the source code of an
HTML file and grab the value of an attribute given the tag and the
attribute that would be grabbed. For
Wyle Laboratories, Inc. | Web Developer
-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 22, 2005 4:14 PM
To: CF-Talk
Subject: Re: regex help for grabbing values of html tag attributes
What version of CF?
--Ben
Burns, John D wrote:
Does anyone have
Well, I see a couple of problems with what you're using. First, you've
not got a closing on the attribute. Second, you've wrapped a regex
that contains a in 's, which will error out if you don't escape the
inner 's. You can wrap it with single quotes to fix that. Also, the
last * boggles
PM
To: CF-Talk
Subject: Re: regex help for grabbing values of html tag attributes
Well, I see a couple of problems with what you're using. First, you've
not got a closing on the attribute. Second, you've wrapped a regex
that contains a in 's, which will error out if you don't escape the
inner
Try
refindnocase('img.*?src=(.*?).*?',cfhttp.fileContent,1,'true')
I think the 0 and the non-quoted true are confusing it. Just a guess,
though. Also, have you verified the contents of cfhttp.filecontent?
--Ben
Burns, John D wrote:
Ben,
I can see what you've got (I think) and it makes
What you're trying to do is far from being trivial, however, I'm pretty
sure that
CF_REextract should help you a lot. See the link below.
--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to
Cedric Villat wrote:
I want to remove all periods ( . ) that do not appear between 2 numbers. For
instance, I would want to keep this period:
5.5
But not these:
www.domain.com
I want the periods to be replaces with a space in the second example.
Anyone?
I don't think there's any
What about 10.24? Would that have the full stop(period) removed?
Ade
-Original Message-
From: Cedric Villat [mailto:[EMAIL PROTECTED]
Sent: 21 February 2005 01:15
To: CF-Talk
Subject: RegEx help
I'm trying to create a regex that does the following, with little luck so
far.
I want
the immediate characters around the period are not important.
Thanks,
Cedric
What about 10.24? Would that have the full stop(period) removed?
Ade
-Original Message-
From: Cedric Villat [mailto:[EMAIL PROTECTED]
Sent: 21 February 2005 01:15
To: CF-Talk
Subject: RegEx help
I'm trying
Pete,
Thanks, that was the way I thought I would have to go. Just was hoping there
was an easier way :) I'd still like to see if it can be done in 1 *line* :)
Thanks.
Cedric
Cedric Villat wrote:
I don't think there's any sane way to do this with a single POSIX regexp
(I think I could do it
Assuming CFMX:
rereplace(text,(?(.)\.([^0-9]))|(?([^0-9])\.(.)), \1\2, all);
Not tested, YMMV, there are a lot of parens and it wouldn't surprise me
if I'm off somewhere, etc. But the basic idea is to check for either a
non-number before or after the dot.
--Ben
Cedric Villat wrote:
Pete,
Ben,
That makes sense. I get an error though, as it complains about the ?. What are
they for? I thought the ? was the 0 or 1 occurances operator.
Also, would this cover things like:
12.2.12.12 ?
I noticed that my current regex of
m = REReplace(m, ([0-9])\.([0-9]), \1|\2, ALL);
generate
The question marks in this instance are instructions to not create a
backreference for that set of parens. You can drop them, but you might
have to adjust which backreferences you use in the replace param.
Now that you mention it, you're right: this will fail on
www.a.com
but not
www.aa.com
Ben,
I got it working with:
REReplace(text, ((.)\.([^0-9]))|([^0-9]\.(.)), \2 \3, all);
Cedric
Ben,
That makes sense. I get an error though, as it complains about the ?.
What are they for? I thought the ? was the 0 or 1 occurances
operator.
Also, would this cover things like:
Cedric Villat wrote:
I get an error though, as it complains about the ?. What are they for?
It's a (mistyped :) Perl extension that POSIX (and CF) don't support:
'?:' after the '(' stops the parenthesised section being treated as a
referenceable subexpression: it's just used for grouping.
It's a (mistyped :) Perl extension that POSIX (and CF) don't support:
'?:' after the '(' stops the parenthesised section being treated as a
referenceable subexpression: it's just used for grouping.
Oops. It was mistyped! That's what I get for Copy'N'Pasting. Also,
for trying to answer
Ben Doom wrote:
Oops. It was mistyped! That's what I get for Copy'N'Pasting. Also,
for trying to answer questions on a Monday. However, it is supported in
CFMX, which no longer uses a POSIX engine.
Non-greedy or lazy matching is supported in CFMX. IIRC, lookahead is as
well, but
For a variety of reasons, we skipped CF6MX and are only now working
through migration issues for CF7MX: I hadn't picked up on the extended
regexp facilities, only that the new engine seems to be some three times
faster than CF5. Still far too slow, but any improvement is welcome.
Yeah,
I'm trying to create a regex that does the following, with little luck so
far.
I want to remove all periods ( . ) that do not appear between 2 numbers. For
instance, I would want to keep this period:
5.5
But not these:
www.domain.com
I want the periods to be replaces with a space in the
The regex works for most cases... but it's not stopping at the next ending
tag...
For example, the quote replac regex...
I have
[quote]heres a quote[/quote]
Here's some text
[quote]here's another quote[/quote]
The expression replaces quote tags with blockquote tags unless it false
between
: RE: regex help (Almost)
The regex works for most cases... but it's not stopping at the next ending
tag...
For example, the quote replac regex...
I have
[quote]heres a quote[/quote]
Here's some text
[quote]here's another quote[/quote]
The expression replaces quote tags with blockquote tags
\2/blockquote, ALL)
-Original Message-
From: Ewok [mailto:[EMAIL PROTECTED]
Sent: Monday, 17 January 2005 10:01 a.m.
To: CF-Talk
Subject: RE: regex help (Almost)
The regex works for most cases... but it's not stopping at the next ending
tag...
For example, the quote replac regex...
I
MAN! How simple was that! Uhgg thanks guys
-Original Message-
From: Mike Nicholls [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 16, 2005 4:11 PM
To: CF-Talk
Subject: RE: regex help (Almost)
Regular expressions are greedy by default, they match as much as they can.
Adding
Incase you havent realized regex's arent my forte!
This seems to be the last little kink to get out of this thing and it will
be set (or I'm going back to the original Jim Davis loop!)
str = rereplace(str, (\[hr\])(?!(?!\[code\]).*?\[/code\]), hr, ALL);
this regex works perfectly as long
Still fighting that thing, eh? I spent 3 hours this afternoon trying
to figure out why a simple INSERT query wouldn't work... finally I
wrapped the query text in ## and a cfoutput, then copy/pasted it into
Query Analyzer... only to find out that the problem was a new column
in the database that
:[EMAIL PROTECTED]
Sent: Sunday, January 16, 2005 8:24 PM
To: CF-Talk
Subject: Re: regex help (Almost)
Still fighting that thing, eh? I spent 3 hours this afternoon trying
to figure out why a simple INSERT query wouldn't work... finally I
wrapped the query text in ## and a cfoutput, then copy/pasted
Geeze,
I sure hope anyone who read this paragraph:
Still fighting that thing, eh? I spent 3 hours this afternoon trying
to figure out why a simple INSERT query wouldn't work... finally I
wrapped the query text in ## and a cfoutput, then copy/pasted it into
Query Analyzer... only to find out that
16, 2005 10:45 PM
To: CF-Talk
Subject: Re: regex help (Almost)
Geeze,
I sure hope anyone who read this paragraph:
Still fighting that thing, eh? I spent 3 hours this afternoon trying
to figure out why a simple INSERT query wouldn't work... finally I
wrapped the query text in ## and a cfoutput
:P
I just read the note I sent and thought Good god, that sucked.
Figured if I thought it, someone else probably did too. But then,
we're all our own worse critics...
And I only got 2 cups of coffee today... every time I went to fill my
cup, the pot was empty.
Hey, maybe that's the problem...
This is a tough one...
It's an old bbml parser I wrote a while back and im trying to modify it a
little.
I want to search through the string and replace all instances of [b] with
b UNLESS it falls between [pre] and [/pre]
I just can't seem to get it right.
Replace [b] with b except when it
-Original Message-
From: Ewok [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 15, 2005 4:05 AM
To: CF-Talk
Subject: regex help
This is a tough one...
It's an old bbml parser I wrote a while back and im trying to modify it a
little.
I want to search through the string
H... lets see...
You'd want to use a few UDFs, and a struct or two...
first UDF would be findAllCodeTags, and would call findCodeTag, which
would find a code tag and return the pos, and len, arrays, which
findAllCodeTags would store in an array.
Then, you'd want a findAllBTags and findBTag,
15, 2005 1:00 PM
To: CF-Talk
Subject: RE: regex help
-Original Message-
From: Ewok [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 15, 2005 4:05 AM
To: CF-Talk
Subject: regex help
This is a tough one...
It's an old bbml parser I wrote a while back and im trying to modify
.
Thanks for the brain jump start.
-Original Message-
From: Jared Rypka-Hauer - CMG, LLC [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 15, 2005 1:33 PM
To: CF-Talk
Subject: Re: regex help
H... lets see...
You'd want to use a few UDFs, and a struct or two...
first UDF would
, January 15, 2005 1:33 PM
To: CF-Talk
Subject: Re: regex help
H... lets see...
You'd want to use a few UDFs, and a struct or two...
first UDF would be findAllCodeTags, and would call findCodeTag, which
would find a code tag and return the pos, and len, arrays, which
findAllCodeTags
Great... I'll take a look, thanks.
Ha storage ROOM... we have a storage BARN can you say museum?
-Original Message-
From: Jared Rypka-Hauer - CMG, LLC [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 15, 2005 3:11 PM
To: CF-Talk
Subject: Re: regex help
O
Duh... I think
-Original Message-
From: Ewok [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 15, 2005 2:24 PM
To: CF-Talk
Subject: RE: regex help
Thanks! I'll go take a look. On another note... I seem to remember a
colorcode tag that would color code for you. I can't say rather or not
it
had
Wow that was a pain...
Thanks Jim. I was able to use portions of your code (very little change) to
get it done...
//Code from Jim Davis' DP_ParseBBML
CodeBlocks = ArrayNew(1);
CurPos=1;
while (FindNoCase([code], str, CurPos) GT 0)
{
sCodePos = FindNoCase([code], str, CurPos) + 6;
-Original Message-
From: Ewok [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 15, 2005 7:33 PM
To: CF-Talk
Subject: RE: regex help
Wow that was a pain...
Thanks Jim. I was able to use portions of your code (very little change)
to
get it done...
any objections to me
The following regex should do the trick..
cfset changed = rereplace(temp,
(\[b\]([Aa-zZ0-9\s]*)\[\/b\])(?!((?!pre).)*?\/pre), b\2/b,
ALL)
note the backrefrence \2 is to ([Aa-zZ0-9\s]*).. do not use the dot
notation in there.
--
Regards
Ewok wrote:
This is a tough one...
It's an old bbml
Err.. the pre points to pre it should be [pre].. fixed one below..
(\[b\]([Aa-zZ0-9\s]*)\[/b\])(?!((?!\[pre\]).)*?\[/pre\])
Umer Farooq wrote:
The following regex should do the trick..
cfset changed = rereplace(temp,
(\[b\]([Aa-zZ0-9\s]*)\[\/b\])(?!((?!pre).)*?\/pre), b\2/b,
ALL)
note
: Saturday, January 15, 2005 9:41 PM
To: CF-Talk
Subject: Re: regex help
Err.. the pre points to pre it should be [pre].. fixed one below..
(\[b\]([Aa-zZ0-9\s]*)\[/b\])(?!((?!\[pre\]).)*?\[/pre\])
Umer Farooq wrote:
The following regex should do the trick..
cfset changed = rereplace(temp
and use your original as long as it doesnt
give me a fit on tags without closing tags smileys, [hr] etc... Thanks
again. Nice job!
-Original Message-
From: Umer Farooq [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 15, 2005 9:41 PM
To: CF-Talk
Subject: Re: regex help
Err
: Umer Farooq [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 15, 2005 11:55 PM
To: CF-Talk
Subject: Re: regex help
NP..
ya.. it should work out just fine.. as you already have the single
tag replace code below.. and original will make things faster.. if you
gota do it over lot of code
, STEVEN J (AIT) [mailto:[EMAIL PROTECTED]
Sent: 10 January 2005 20:43
To: CF-Talk
Subject: Regex Help.
Hi All,
Need some help with a regex. What I'm trying to do is validate and
input in javascript.
The users are allowed to input a number.
It can be in the following formats:
9
9.9
Hi All,
Need some help with a regex. What I'm trying to do is validate and
input in javascript.
The users are allowed to input a number.
It can be in the following formats:
9
9.9
9.99
.99
.9
(9 used inplace of any digit.)
I tried using \b[0-9.]+ and I've tried \b[\d]*([.]?[\d]{0,2})?
Can you use isNaN here?
Just use it on your number to verify that it is or is not a number...
what's your code look like?
On Mon, 10 Jan 2005 14:43:27 -0500, DURETTE, STEVEN J (AIT)
[EMAIL PROTECTED] wrote:
Hi All,
Need some help with a regex. What I'm trying to do is validate and
input
I think this will work..
^\d{1,2}.\d{1,2}$
(not tested)
On Mon, 10 Jan 2005 14:43:27 -0500, DURETTE, STEVEN J (AIT)
[EMAIL PROTECTED] wrote:
Hi All,
Need some help with a regex. What I'm trying to do is validate and
input in javascript.
The users are allowed to input a number.
It
^[\d]*([.]?[\d]{1,2})?$
there that will catch 9, 9.9, 9.99, will not catch 9. 9.9.9, etc
On Mon, 10 Jan 2005 13:51:23 -0600, Greg Morphis [EMAIL PROTECTED] wrote:
I think this will work..
^\d{1,2}.\d{1,2}$
(not tested)
On Mon, 10 Jan 2005 14:43:27 -0500, DURETTE, STEVEN J (AIT)
Thanks, That did it.
-Original Message-
From: Greg Morphis [mailto:[EMAIL PROTECTED]
Sent: Monday, January 10, 2005 2:57 PM
To: CF-Talk
Subject: Re: Regex Help.
^[\d]*([.]?[\d]{1,2})?$
there that will catch 9, 9.9, 9.99, will not catch 9. 9.9.9, etc
On Mon, 10 Jan 2005 13:51:23
Opps,
That didn't work after all. User puts in D and it evaluates to true
with that reg ex.
Steve
-Original Message-
From: Greg Morphis [mailto:[EMAIL PROTECTED]
Sent: Monday, January 10, 2005 2:57 PM
To: CF-Talk
Subject: Re: Regex Help.
^[\d]*([.]?[\d]{1,2
and it evaluates to true
with that reg ex.
Steve
-Original Message-
From: Greg Morphis [mailto:[EMAIL PROTECTED]
Sent: Monday, January 10, 2005 2:57 PM
To: CF-Talk
Subject: Re: Regex Help.
^[\d]*([.]?[\d]{1,2})?$
there that will catch 9, 9.9, 9.99, will not catch 9. 9.9.9, etc
I would post this to the RegEx list, but I'm short on time and the HoF web site
is giving me fits when I try to subscribe. :)
I just got a major problem dumped in my lap. We have about 1/2 a gig of pure
HTML files that are screwed up and the boss wants them fixed yesterday. I'm
writing a CF
Well, it seems to me that there should be a space after every comma,
anyway, so couldn't you just do a simple replace() to replace commas
with a comma and a space?
--Ben
Todd wrote:
I would post this to the RegEx list, but I'm short on time and the
HoF web site is giving me fits when I try
Subject: Re: SOT: RegEx help
Well, it seems to me that there should be a space after every comma,
anyway, so couldn't you just do a simple replace() to replace commas
with a comma and a space?
--Ben
~|
Special thanks to the CF
and everywhere else would cause any confusion.
- Original Message -
From: Ben Doom [EMAIL PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
Sent: Monday, January 03, 2005 9:36 AM
Subject: Re: SOT: RegEx help
Well, it seems to me that there should be a space after every comma,
anyway
Hey Ian,
Think it may be your pound signsturn d!#$ into d!##$ and see what happens.
Cheers,
Joe
On Fri, 3 Dec 2004 14:36:29 -0800, Ian Skinner
[EMAIL PROTECTED] wrote:
I am getting a ColdFusion error trying to use my favorite RegEx E-mail
validation. I have always used this
I am getting a ColdFusion error trying to use my favorite RegEx E-mail
validation. I have always used this expression client side in JS, I am not
trying to use this in ColdFusion for the first time. I assume I am running
into the problem of ColdFusion's limited RegEx support, but I am not
I'm trying to parse through some information in a text document where
there is information like this:
Text text text text text text text
FirstName: Bob Age: 30 text text text
text text text text text LastName: Brown text text
text text text
but this information is also within a bunch of other
What version of Cold Fusion? How long is the longest possible string you are searching
through?
If newer than cf 5, or cf 5 and the max string is less than 20KB,
cfset fieldName=FirstName
cfset fieldVal=rereplace(content,.*#fieldName#: +([^ ]+) +.*,\1)
(I think)
Jerry Johnson
[EMAIL
[mailto:[EMAIL PROTECTED]
Sent: Thursday, October 21, 2004 12:41 PM
To: CF-Talk
Subject: Re: RegEx help
What version of Cold Fusion? How long is the longest possible string you
are searching through?
If newer than cf 5, or cf 5 and the max string is less than 20KB,
cfset fieldName=FirstName
cfset
using CFMX. I'm not very
good with Regexs so I'm not sure what's wrong, but it seems to not be
stripping anything out.
John
-Original Message-
From: Jerry Johnson [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 21, 2004 12:41 PM
To: CF-Talk
Subject: Re: RegEx help
What
A bigger question is whether my logic holds together.
Sanity check from a ninja, please.
Notes:
I assumed matching the fieldname's case was a good thing (to reduce false positives)
I assumed the characters before and after the data were, in fact, spaces (chr(32)). If
not, then maybe the
, 2004 1:28 PM
To: CF-Talk
Subject: Re: RegEx help
Are you sure you've got the fieldname correct? Capitilization counts.
If you want to do a case-insensitive search, use rereplacenocase()
instead.
--Ben
Burns, John D wrote:
Hmmm, I think I see what you're trying to do there, but it doesn't
work
Jerry Johnson wrote:
Notes:
I assumed matching the fieldname's case was a good thing (to
reduce false positives)
I would have assumed the same. That was my first thought.
I assumed the characters before and after the data were, in fact,
spaces (chr(32)). If not, then maybe the
, October 21, 2004 2:09 PM
To: CF-Talk
Subject: Re: RegEx help
Jerry Johnson wrote:
Notes:
I assumed matching the fieldname's case was a good thing (to
reduce false positives)
I would have assumed the same. That was my first thought.
I assumed the characters before and after the data were
PROTECTED]
Sent: Thursday, October 21, 2004 1:28 PM
To: CF-Talk
Subject: Re: RegEx help
Are you sure you've got the fieldname correct? Capitilization counts.
If you want to do a case-insensitive search, use rereplacenocase()
instead.
--Ben
Both!
You should probably replace the second and third spaces with the generic space
class. This will allow tabs, returns, and spaces.
[[:space:]]
The last character issue I didn't handle at all.
Maybe something along these lines (completely not tested)
cfset fieldName=FirstName
cfset
) was not a space,
but rather a line break, this wouldn't work. What would I need to make
sure this would work if the value was the last item on a line?
John
-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 21, 2004 2:20 PM
To: CF-Talk
Subject: Re: RegEx help
I'm thinking there is a line feed or tab (which looks like a space in outputed HTM)
between the Bob and the LastName.
Jerry Johnson
[EMAIL PROTECTED] 10/21/04 02:20PM
That doesn't make any sense. I'm scratching my head on this one. I
just ran a quick test (empasis on quick) and it seemed
PROTECTED]
Sent: Thursday, October 21, 2004 2:27 PM
To: CF-Talk
Subject: RE: RegEx help
Both!
You should probably replace the second and third spaces with the
generic space class. This will allow tabs, returns, and spaces.
[[:space:]]
The last character issue I didn't handle at all.
Maybe
I might have jumped too many steps myself.
The \1 is a varaible created by the first set of (). the () say grab whatever you
find in between here, and save it for later use
The \1 is because it was the first answer grabbed. If we wanted the second set
grabbed, it would be \2, and so on.
Try
-
From: Jerry Johnson [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 21, 2004 2:27 PM
To: CF-Talk
Subject: RE: RegEx help
Both!
You should probably replace the second and third spaces with the
generic space class. This will allow tabs, returns, and spaces.
[[:space:]]
The last
Got frisky with the [] brackets.
(Must be missing the old days when ][ meant a really good computer and + meant a
whopping 16KB extra RAM)
Jerry Johnson
[EMAIL PROTECTED] 10/21/04 02:41PM
Oops! A slight mistake in there.
: Thursday, October 21, 2004 2:41 PM
To: CF-Talk
Subject: Re: RegEx help
Oops! A slight mistake in there.
reReplaceNoCase(content,.*#fieldName#:[[:space:]]+([^[:space:]]+)($|[[:
space:]]+.*),\1)
Some notes:
[[:space:]] represents spaces, tabs, various end-of-line characters (10
and 13 for sure
-
From: Burns, John D [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 21, 2004 12:26 PM
To: CF-Talk
Subject: RegEx help
I'm trying to parse through some information in a text document where
there is information like this:
Text text text text text text text
FirstName: Bob Age: 30 text text text
This is working ok in CF5 but apparently not in CFMX
Malformed regular _expression_ \[[^\]*\].
Reason: Unmatched [] in _expression_..
REReplace(ThisTag.GeneratedContent, \[[^\]*\], , All)
it's supposed to strip all [] with everyting inbetween the brackets
[Todays Threads]
[This Message]
-Talk
Subject: [Spam?] Re: Regex help
This is working ok in CF5 but apparently not in CFMX
Malformed regular _expression_ \[[^\]*\].
Reason: Unmatched [] in _expression_..
REReplace(ThisTag.GeneratedContent, \[[^\]*\], , All)
it's supposed to strip all [] with everyting inbetween
The answer is (w{3})? , but in your case: why bother?
-Original Message-
From: Michael T. Tangorre [mailto:[EMAIL PROTECTED]
Sent: 03 July 2004 05:52
To: CF-Talk
Subject: RE: Regex help
How would I say
Www is optional?
var linkRE = /^https?\:\/\/[wW]{3}?/;
[Todays Threads
of most formats. I seem to remember it didn't validate IPs or ports
but most of the rest. I left my copy at work, so I can't verify.
Pascal
-Original Message-
From: Michael T. Tangorre [mailto:[EMAIL PROTECTED]
Sent: 03 July 2004 05:20
To: CF-Talk
Subject: RE: Regex help
If you
Im not sure what the best check would be
The best would sure be to CFHTTP the addres and check for the code returned.
Even a syntactically correct address may be a bad address.
--
___
REUSE CODE! Use custom tags;
See
Does anyone have a regex handy to check a potential link.
For instance: I need to make sure the link specified is in the following
format
http://www.whatever OR http://something
Im not sure what the best check would be, I guess this is the least common
denominator for strictly http links.
On Jul 2, 2004, at 8:01 PM, Michael T. Tangorre wrote:
Does anyone have a regex handy to check a potential link.
For instance: I need to make sure the link specified is in the
following
format
http://www.whatever OR http://something
Im not sure what the best check would be, I guess this is
If you are just scanning text to find any links, just look
for something like:
'http://[^ ]*
Dick, I have a variation of above which checks for http or https followed by
a : followed by a an optional www followed by any number of letters, numbers
or periods. I just wanted to make sure I am
How would I say
Www is optional?
var linkRE = /^https?\:\/\/[wW]{3}?/;
Mike
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
You are on the right track,
You might need to use several regexps to extract any valid format, then
see if you have anything left.
AFAIK, valid chars would be:
cfset V = [A-Za-z0_-] /
so you check for 1-n V period 1-n V period 1-n V
that takes char of the domain address
from now on you also
more accurately you should say [A-Za-z0-9]+
one or more of the above -- www is acceptable, but not required.
Dick
On Jul 2, 2004, at 8:52 PM, Michael T. Tangorre wrote:
How would I say
Www is optional?
var linkRE = /^https?\:\/\/[wW]{3}?/;
Mike
[Todays Threads]
[This Message]
I've dabbled in regex, but am not very good at it yet :-)Anyone
willing to help with this would be extremely helpful.
I have a string (actually coming from cgi.http_referer) and I append a
variable to the end to pass the status of an operation back to the
original page.I do this for errors and
: Friday, April 02, 2004 10:43 AM
To: CF-Talk
Subject: Regex help
I've dabbled in regex, but am not very good at it yet :-)Anyone
willing to help with this would be extremely helpful.
I have a string (actually coming from cgi.http_referer) and I append a
variable to the end to pass
301 - 400 of 614 matches
Mail list logo