regexp

2002-08-01 Thread Kodjo Ackah

Hi,
The snippet below does check to ensure that a user puts in a digit in a
form.
The problem is - if I test this code like adding a letter to the digit
it does not flag the error.
I will like to ensure that only digits are allowed and if anyone as much
as adds a digit after or before -
an error will be raised! 
Any bright ideas?

  





__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
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



RegExp Help

2003-03-26 Thread David Collie (itndac)
Can anyone help me with the RegExp for stripping out content between two
defined tags... ie


...
Content to strip out
...


I would need it to strip out all the content and the tags themselves as
well...

TaInAdvance
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



CFINPUT & RegExp

2003-01-27 Thread Gerry Pauline
CFxperts:

I'm using CFFORM to create an online survey for a user. In one of the
CFINPUT tags, I'm using a regular express to validate an entry. I coded
the VALIDATE= and PATTERN= parms as follows:

   

The text should contain three numeric quadrants delimited by hyphens,
for example: 1000-909-1033. As you may guess, it doesn't seem to be
working. According to the manual, a JavaScript regular expression should
be used, which I believe is specified correctly.

The CFFORM tag is coded as follows:



As you can see, it calls another JS function in addition to using the
builtin valadation features of the CFINPUT tag. The other tags using the
CFINPUT validation calls all work OK (only the tag above uses a regular
expression).

Could someone please advise me on what I'm doing wrong (besides being
lazy and using CFFORM in the first place !). Any and all
advise/suggestions/help will be gratefully appreciated !

Thank you.

-Gerry

Gerard T. Pauline
Mgr, Internet Applications
Computer Systems, DoIT
Pace University
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4




Re: regexp

2002-08-01 Thread Michael Dinowitz

Try this:
^[0-9]+$
A string must start (^) with a number ([0-9]), at least one number must exist (+) and 
the string ends after one or more numbers ($).


> Hi,
> The snippet below does check to ensure that a user puts in a digit in a
> form.
> The problem is - if I test this code like adding a letter to the digit
> it does not flag the error.
> I will like to ensure that only digits are allowed and if anyone as much
> as adds a digit after or before -
> an error will be raised! 
> Any bright ideas?
> 
>   
> 
>  "job_amount")>
> 
> 
> 
> 
__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
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



Re: regexp

2002-08-01 Thread S . Isaac Dealey

> Hi,
> The snippet below does check to ensure that a user puts in a digit in a
> form.
> The problem is - if I test this code like adding a letter to the digit
> it does not flag the error.
> I will like to ensure that only digits are allowed and if anyone as much
> as adds a digit after or before -
> an error will be raised!
> Any bright ideas?

>   
>   
>"job_amount")>
>   
>   

You're wanting to validate monetary values people are assigning to jobs? ...
The issue you're having is that you're going about validation in reverse --
you want to ensure that the field contains no non-numeric values, rather
than ensuring that it contains numeric values as above... so... I would
probably use this as being the simplest solution (doesn't even require any
regex):





Isaac Dealey
Certified Advanced ColdFusion Developer

www.turnkey.to
954-776-0046
__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
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



RE: regexp

2002-08-01 Thread Ben Doom

:   

This only checks to see if a digit exists.  Try something like this:


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



Re: regexp

2002-08-01 Thread S . Isaac Dealey

> Try this:
> ^[0-9]+$
> A string must start (^) with a number ([0-9]), at least one number must
> exist (+) and the string ends after one or more numbers ($).


Oooh oooh! ...

function IsNumeric(string) {
return yesnoformat(REFind("^[0-9]$",string));
}

isnumeric("3") = yes
usnumeric("3,000") = no

Wow that would be useful... How come on one's thought of that before? :)

Sorry Mike... just poking a little geeky fun at your expense. :)

Although actually, if the field is supposed to be numeric you can make it a
little easier on some of the slower ( mentally ) users by eliminate dollar
signs, commas and decimals which are common formatting elements for money
values... which can be done with regex, although I think I would probably
wind up using replacelist


Isaac Dealey
Certified Advanced ColdFusion Developer

www.turnkey.to
954-776-0046
__
Get the mailserver that powers this list at http://www.coolfusion.com
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



Re: regexp

2002-08-01 Thread Michael Dinowitz

The IsNumeric() approach is better than using RegEx. Less overhead.

> 
> 
> 
> 
> Isaac Dealey
> Certified Advanced ColdFusion Developer
> 
> www.turnkey.to
> 954-776-0046
> 
__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: regexp

2002-08-01 Thread S . Isaac Dealey

> The IsNumeric() approach is better than using RegEx. Less overhead.
>
>> 
>> 
>> 

And after I went and poked fun at you, you backed me up. :)

Isaac Dealey
Certified Advanced ColdFusion Developer

www.turnkey.to
954-776-0046
__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: regexp

2002-08-01 Thread Patrick McElhaney

Not so fast, mister!

The function you describe would be more appropriately
named isInteger(). ;-)


Patrick

> -Original Message-
> From: S.Isaac Dealey [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 01, 2002 3:42 PM
> To: CF-Talk
> Subject: Re: regexp
>
>
> > Try this:
> > ^[0-9]+$
> > A string must start (^) with a number ([0-9]), at least one number must
> > exist (+) and the string ends after one or more numbers ($).
>
>
> Oooh oooh! ...
>
> function IsNumeric(string) {
>   return yesnoformat(REFind("^[0-9]$",string));
> }
>
> isnumeric("3") = yes
> usnumeric("3,000") = no
>
> Wow that would be useful... How come on one's thought of that before? :)
>
> Sorry Mike... just poking a little geeky fun at your expense. :)
>
> Although actually, if the field is supposed to be numeric you can
> make it a
> little easier on some of the slower ( mentally ) users by eliminate dollar
> signs, commas and decimals which are common formatting elements for money
> values... which can be done with regex, although I think I would probably
> wind up using replacelist
>
>
> Isaac Dealey
> Certified Advanced ColdFusion Developer
>
> www.turnkey.to
> 954-776-0046

__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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



Re: regexp

2002-08-01 Thread Michael Dinowitz

Well, he asked for RegEx and I gave him RegEx. The IsNumeric is better but I got 
directly into teaching mode. :)


> > Try this:
> > ^[0-9]+$
> > A string must start (^) with a number ([0-9]), at least one number must
> > exist (+) and the string ends after one or more numbers ($).
> 
> 
> Oooh oooh! ...
> 
> function IsNumeric(string) {
> return yesnoformat(REFind("^[0-9]$",string));
> }
> 
> isnumeric("3") = yes
> usnumeric("3,000") = no
> 
> Wow that would be useful... How come on one's thought of that before? :)
> 
> Sorry Mike... just poking a little geeky fun at your expense. :)
> 
> Although actually, if the field is supposed to be numeric you can make it a
> little easier on some of the slower ( mentally ) users by eliminate dollar
> signs, commas and decimals which are common formatting elements for money
> values... which can be done with regex, although I think I would probably
> wind up using replacelist
> 
> 
> Isaac Dealey
> Certified Advanced ColdFusion Developer
> 
> www.turnkey.to
> 954-776-0046
> 
__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: regexp

2002-08-01 Thread todd

Not to mention isNumeric() in J's post is ... well, illegal.  It already 
exist in CF and it'll throw an error.  Heh, to bad we can overwrite those 
functions like you can in flash. ;)

~Todd

On Thu, 1 Aug 2002, Michael Dinowitz wrote:

> Well, he asked for RegEx and I gave him RegEx. The IsNumeric is better but I got 
>directly into teaching mode. :)
> 
> 
> > > Try this:
> > > ^[0-9]+$
> > > A string must start (^) with a number ([0-9]), at least one number must
> > > exist (+) and the string ends after one or more numbers ($).
> > 
> > 
> > Oooh oooh! ...
> > 
> > function IsNumeric(string) {
> > return yesnoformat(REFind("^[0-9]$",string));
> > }
> > 
> > isnumeric("3") = yes
> > usnumeric("3,000") = no
> > 
> > Wow that would be useful... How come on one's thought of that before? :)
> > 
> > Sorry Mike... just poking a little geeky fun at your expense. :)
> > 
> > Although actually, if the field is supposed to be numeric you can make it a
> > little easier on some of the slower ( mentally ) users by eliminate dollar
> > signs, commas and decimals which are common formatting elements for money
> > values... which can be done with regex, although I think I would probably
> > wind up using replacelist
> > 
> > 
> > Isaac Dealey
> > Certified Advanced ColdFusion Developer
> > 
> > www.turnkey.to
> > 954-776-0046
> > 
> 
__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: regexp

2002-08-01 Thread S . Isaac Dealey

> Well, he asked for RegEx and I gave him RegEx. The IsNumeric is better but
> I got directly into teaching mode. :)

Yea, it happens to all of us at one point or another. :) I wish I could get
paid for teaching this stuff, that would be awesome. :)


Isaac Dealey
Certified Advanced ColdFusion Developer

www.turnkey.to
954-776-0046
__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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



RE: regexp

2002-08-01 Thread S . Isaac Dealey

> Not so fast, mister!
>
> The function you describe would be more appropriately
> named isInteger(). ;-)
>
> Patrick


Aha! The brass comes out. :) Yea, you're right... I'm sure there was a
rationalle for IsNumeric() validating integers... I guess then there is a
case for using REGex in a function to do this... IsFloat() :) Interrestingly
enough, a quick search of cflib.org reveals an IsInt() function, but no
IsFloat() ... hmmm...


Isaac Dealey
Certified Advanced ColdFusion Developer

www.turnkey.to
954-776-0046
__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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



Re: regexp

2002-08-01 Thread S . Isaac Dealey

> Not to mention isNumeric() in J's post is ... well, illegal.  It already
> exist in CF and it'll throw an error.  Heh, to bad we can overwrite those
> functions like you can in flash. ;)

Who's J? ... Yea, I knew it was illegal, it was just for the purpose of the
jab. :) I could have said "function IsReallyAndCertainlyAbsolutelyVeryDefini
telyNumericAndNothingElseYeaYeaImTheMidnightBomberWhatBombsAtMidnightYeaYea(
string)" ... though I'm not sure I'd want to type that very often. :)

Isaac Dealey
Certified Advanced ColdFusion Developer

www.turnkey.to
954-776-0046

> ~Todd

> On Thu, 1 Aug 2002, Michael Dinowitz wrote:

>> Well, he asked for RegEx and I gave him RegEx. The IsNumeric is better
>> but I got directly into teaching mode. :)
>>
>>
>> > > Try this:
>> > > ^[0-9]+$
>> > > A string must start (^) with a number ([0-9]), at least one number
>> > > must
>> > > exist (+) and the string ends after one or more numbers ($).
>> >
>> >
>> > Oooh oooh! ...
>> >
>> > function IsNumeric(string) {
>> > return yesnoformat(REFind("^[0-9]$",string));
>> > }
>> >
>> > isnumeric("3") = yes
>> > usnumeric("3,000") = no
>> >
>> > Wow that would be useful... How come on one's thought of that before?
>> > :)
>> >
>> > Sorry Mike... just poking a little geeky fun at your expense. :)
>> >
>> > Although actually, if the field is supposed to be numeric you can make
>> > it a
>> > little easier on some of the slower ( mentally ) users by eliminate
>> > dollar
>> > signs, commas and decimals which are common formatting elements for
>> > money
>> > values... which can be done with regex, although I think I would
>> > probably
>> > wind up using replacelist
>> >
>> >
>> > Isaac Dealey
>> > Certified Advanced ColdFusion Developer
>> >
>> > www.turnkey.to
>> > 954-776-0046
>> >
>>
> 
__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: regexp

2002-08-01 Thread Mark A. Kruger - CFG

You could use a snippet...

-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 3:21 PM
To: CF-Talk
Subject: Re: regexp


> Not to mention isNumeric() in J's post is ... well, illegal.  It already
> exist in CF and it'll throw an error.  Heh, to bad we can overwrite those
> functions like you can in flash. ;)

Who's J? ... Yea, I knew it was illegal, it was just for the purpose of the
jab. :) I could have said "function IsReallyAndCertainlyAbsolutelyVeryDefini
telyNumericAndNothingElseYeaYeaImTheMidnightBomberWhatBombsAtMidnightYeaYea(
string)" ... though I'm not sure I'd want to type that very often. :)

Isaac Dealey
Certified Advanced ColdFusion Developer

www.turnkey.to
954-776-0046

> ~Todd

> On Thu, 1 Aug 2002, Michael Dinowitz wrote:

>> Well, he asked for RegEx and I gave him RegEx. The IsNumeric is better
>> but I got directly into teaching mode. :)
>>
>>
>> > > Try this:
>> > > ^[0-9]+$
>> > > A string must start (^) with a number ([0-9]), at least one number
>> > > must
>> > > exist (+) and the string ends after one or more numbers ($).
>> >
>> >
>> > Oooh oooh! ...
>> >
>> > function IsNumeric(string) {
>> > return yesnoformat(REFind("^[0-9]$",string));
>> > }
>> >
>> > isnumeric("3") = yes
>> > usnumeric("3,000") = no
>> >
>> > Wow that would be useful... How come on one's thought of that before?
>> > :)
>> >
>> > Sorry Mike... just poking a little geeky fun at your expense. :)
>> >
>> > Although actually, if the field is supposed to be numeric you can make
>> > it a
>> > little easier on some of the slower ( mentally ) users by eliminate
>> > dollar
>> > signs, commas and decimals which are common formatting elements for
>> > money
>> > values... which can be done with regex, although I think I would
>> > probably
>> > wind up using replacelist
>> >
>> >
>> > Isaac Dealey
>> > Certified Advanced ColdFusion Developer
>> >
>> > www.turnkey.to
>> > 954-776-0046
>> >
>>
>

__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
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



RE: regexp

2002-08-01 Thread S . Isaac Dealey

> You could use a snippet...

LOL... I had 2 simultaneous mixed responses to this:

1) Oooh oooh! ... wait ... nope, nevermind, you lost me...

and

2) Now that's just silly.


Isaac Dealey
Certified Advanced ColdFusion Developer

www.turnkey.to
954-776-0046


> -Original Message-
> From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 01, 2002 3:21 PM
> To: CF-Talk
> Subject: Re: regexp


>> Not to mention isNumeric() in J's post is ... well, illegal.  It already
>> exist in CF and it'll throw an error.  Heh, to bad we can overwrite those
>> functions like you can in flash. ;)

> Who's J? ... Yea, I knew it was illegal, it was just for the purpose of
> the
> jab. :) I could have said "function
> IsReallyAndCertainlyAbsolutelyVeryDefini
> telyNumericAndNothingElseYeaYeaImTheMidnightBomberWhatBombsAtMidnightYeaYe
> a(
> string)" ... though I'm not sure I'd want to type that very often. :)

> Isaac Dealey
> Certified Advanced ColdFusion Developer

> www.turnkey.to
> 954-776-0046

>> ~Todd

>> On Thu, 1 Aug 2002, Michael Dinowitz wrote:

>>> Well, he asked for RegEx and I gave him RegEx. The IsNumeric is better
>>> but I got directly into teaching mode. :)
>>>
>>>
>>> > > Try this:
>>> > > ^[0-9]+$
>>> > > A string must start (^) with a number ([0-9]), at least one number
>>> > > must
>>> > > exist (+) and the string ends after one or more numbers ($).
>>> >
>>> >
>>> > Oooh oooh! ...
>>> >
>>> > function IsNumeric(string) {
>>> > return yesnoformat(REFind("^[0-9]$",string));
>>> > }
>>> >
>>> > isnumeric("3") = yes
>>> > usnumeric("3,000") = no
>>> >
>>> > Wow that would be useful... How come on one's thought of that before?
>>> > :)
>>> >
>>> > Sorry Mike... just poking a little geeky fun at your expense. :)
>>> >
>>> > Although actually, if the field is supposed to be numeric you can make
>>> > it a
>>> > little easier on some of the slower ( mentally ) users by eliminate
>>> > dollar
>>> > signs, commas and decimals which are common formatting elements for
>>> > money
>>> > values... which can be done with regex, although I think I would
>>> > probably
>>> > wind up using replacelist
>>> >
>>> >
>>> > Isaac Dealey
>>> > Certified Advanced ColdFusion Developer
>>> >
>>> > www.turnkey.to
>>> > 954-776-0046
>>> >
>>>
>>

> 
__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
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



Re: regexp

2002-08-01 Thread Michael Dinowitz

Just to bring this thread back onto topic and then end it, Mastering Regular 
Expessions 2 is out. 
http://www.oreilly.com/catalog/regex2/
The best price is at buy.com while the best chance of getting it within the next week 
or two is going directly to O'Reilly. 

__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
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



Re: regexp

2002-08-01 Thread Alex

[^0-9]

On Thu, 1 Aug 2002, Kodjo Ackah wrote:

> Hi,
> The snippet below does check to ensure that a user puts in a digit in a
> form.
> The problem is - if I test this code like adding a letter to the digit
> it does not flag the error.
> I will like to ensure that only digits are allowed and if anyone as much
> as adds a digit after or before -
> an error will be raised!
> Any bright ideas?
>
>   
>   
>"job_amount")>
>   
>   
>
> 
__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: regexp

2002-08-01 Thread S . Isaac Dealey

> Just to bring this thread back onto topic and then end it, Mastering
> Regular Expessions 2 is out.
> http://www.oreilly.com/catalog/regex2/
> The best price is at buy.com while the best chance of getting it within
> the next week or two is going directly to O'Reilly.

Sorry Mike. :)

Isaac Dealey
Certified Advanced ColdFusion Developer

www.turnkey.to
954-776-0046
__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
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



RE: regexp

2002-08-02 Thread Kodjo Ackah

Cheers Guys!
Worked like a charm!
Believe it or not, today I have a choice in what to use!

Kodjo ackah
Principal Consultant
concrete-media.com



__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
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



RegExp Help

2002-03-20 Thread Wallick, Mike

Anyone Have a RegExp to get all content between the  tags? I found a
UDF that parses out the , but I'm trying to modify it to parse out
the  instead, but I'm not having much luck.

Any help would be greatly appreciated.

mike wallick
* web application developer
* [EMAIL PROTECTED]
* 651.628.5377
*  http://www.securecomputing.com


__
Get the mailserver that powers this list at http://www.coolfusion.com
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



RegExp Question

2002-05-17 Thread Van Vliet, Scott

I need to find all #someVariables# in a string, so I came up with the
following RegExp:
 
/#.*[^#]#/ (Which in CF would be "##.*[^##]#)
 
What the HELL am I doing wrong?  This will find the first occurence of the
"#" in a string, but will continue until it finds the last occurence of "#"
- whereas I want it stop at the *next* occurence of "#".
 
TIA!

--
Scott Van Vliet
Sempra Energy
555 W. 5th St., 21st Floor
Los Angeles, CA 90013
Tel > 213.244.5205
Email > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>


"Hello Stupid, and welcome to your crappy computer."
- Strong Bad, HomestarRunner.com




 

__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RegExp Help

2002-05-23 Thread Wallick, Mike

Hey all. I'm trying to cook up a regexp to search a block of text for links.
What I'm looking for is something like:
 

 
I want to read the block of text and replace spaces with %20 so links won't
break. I know, I know, links shouldn't have spaces in them, but this is
something I inherited and changing all the links and filenames associated
with them is not an option (there are thousands of links/files).
 
I've tried this: ',
'', "all")>
 
and this: ', '', "all")>
 
and those don't work. Can I not use CFML functions on a regexp subexpression
(\1) ?
 
I'm not exactly an expert on regexps, so any help would be greatly
appreciated.
 

 

Mike Wallick




Web Application Developer




[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 




651.628.5377




http://www.securecomputing.com <http://www.securecomputing.com/> 

 

 

__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
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



Regexp help

2001-07-17 Thread Bryan LaPlante

I need some help from one of the RegExp guru's. I am trying to get a list of
function names from my page for example the following functions name resides
in the page at position 9 to 17. I need a regular expression that will find
everything between the word function and the parenthesis character ( so that
I can get the word addition into a list. Here is what I have so far.



function addition(a,b){
somevar = a + b;
return somevar;
}

Bryan LaPlante


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



OT: Regexp

2001-08-17 Thread Bruce, Rodney

I need help with a regexp.

I am trying to remove all special chars from file names.
I can remove them one at a time like so: 

tempstring = REREplace(tempstring, " ", "", "all") 
tempstring = REReplace(tempstring, "@", "", "all")
etc

but the # errors out.

How can I do this in one pass,  if possible?

Thanks for any and all help




~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Regexp

2001-08-17 Thread Raymond Camden

Since CF treats # as a variable marker, you have to escape it. Just use ##
to mean one #.

Also, instead of doing multiple REReplaces, use []s.

Ie, tempstring = REREplace(tempstring,"[ @##etc]","","ALL");

===
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email   : [EMAIL PROTECTED]
ICQ UIN : 3679482

"My ally is the Force, and a powerful ally it is." - Yoda

> -Original Message-
> From: Bruce, Rodney [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 17, 2001 5:13 PM
> To: CF-Talk
> Subject: OT: Regexp
>
>
> I need help with a regexp.
>
> I am trying to remove all special chars from file names.
> I can remove them one at a time like so:
>
> tempstring = REREplace(tempstring, " ", "", "all")
> tempstring = REReplace(tempstring, "@", "", "all")
> etc
>
> but the # errors out.
>
> How can I do this in one pass,  if possible?
>
> Thanks for any and all help
>
>
>
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Regexp

2001-08-17 Thread Zac Belado


> but the # errors out.

Have you tried escaping it?

tempstring = REREplace(tempstring, "##", "", "all") 

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Regexp

2001-08-17 Thread Glenn Olsen

What about something like this:

##\*\?\$\^\]">




Glenn Olsen
Doceus

-Original Message-
From: Bruce, Rodney [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 17, 2001 5:13 PM
To: CF-Talk
Subject: OT: Regexp


I need help with a regexp.

I am trying to remove all special chars from file names.
I can remove them one at a time like so: 

tempstring = REREplace(tempstring, " ", "", "all") 
tempstring = REReplace(tempstring, "@", "", "all")
etc

but the # errors out.

How can I do this in one pass,  if possible?

Thanks for any and all help
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Regexp

2001-08-17 Thread Bruce, Rodney

I must be missing something:  here is what I have,  trying to use a UDF. 
The testing file name is ^@#$% $rt4o.txt 
When I run it through this code newfile is D:\documents\^@#$%$rt4o.txt
I left the space separate for testing,  the space is remove but none of the
other chars are


Function removestrangechars(pagestring){

temppage = REReplaceNoCase(pagestring, " ", "", "all");
temppage = ReplaceNoCase(temppage, "[@##$%^&*()]", "",
"all");
return temppage;
}






#newfile#
 

thanks
rodney

-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 17, 2001 2:23 PM
To: CF-Talk
Subject: RE: Regexp


Since CF treats # as a variable marker, you have to escape it. Just use ##
to mean one #.

Also, instead of doing multiple REReplaces, use []s.

Ie, tempstring = REREplace(tempstring,"[ @##etc]","","ALL");

===
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email   : [EMAIL PROTECTED]
ICQ UIN : 3679482

"My ally is the Force, and a powerful ally it is." - Yoda

> -Original Message-
> From: Bruce, Rodney [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 17, 2001 5:13 PM
> To: CF-Talk
> Subject: OT: Regexp
>
>
> I need help with a regexp.
>
> I am trying to remove all special chars from file names.
> I can remove them one at a time like so:
>
> tempstring = REREplace(tempstring, " ", "", "all")
> tempstring = REReplace(tempstring, "@", "", "all")
> etc
>
> but the # errors out.
>
> How can I do this in one pass,  if possible?
>
> Thanks for any and all help
>
>
>
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Regexp

2001-08-17 Thread Bruce, Rodney

DUH
 No typing skill shows up again.
My second Replace  is misspelled below. corrected it and now exp works.

Thanks for all the suggestions and help.
Rodney


-Original Message-
From: Bruce, Rodney 
Sent: Friday, August 17, 2001 2:43 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Regexp


I must be missing something:  here is what I have,  trying to use a UDF. 
The testing file name is ^@#$% $rt4o.txt 
When I run it through this code newfile is D:\documents\^@#$%$rt4o.txt
I left the space separate for testing,  the space is remove but none of the
other chars are


Function removestrangechars(pagestring){

temppage = REReplaceNoCase(pagestring, " ", "", "all");
temppage = ReplaceNoCase(temppage, "[@##$%^&*()]", "",
"all");
return temppage;
}






#newfile#
 

thanks
rodney

-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 17, 2001 2:23 PM
To: CF-Talk
Subject: RE: Regexp


Since CF treats # as a variable marker, you have to escape it. Just use ##
to mean one #.

Also, instead of doing multiple REReplaces, use []s.

Ie, tempstring = REREplace(tempstring,"[ @##etc]","","ALL");

===
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email   : [EMAIL PROTECTED]
ICQ UIN : 3679482

"My ally is the Force, and a powerful ally it is." - Yoda

> -Original Message-
> From: Bruce, Rodney [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 17, 2001 5:13 PM
> To: CF-Talk
> Subject: OT: Regexp
>
>
> I need help with a regexp.
>
> I am trying to remove all special chars from file names.
> I can remove them one at a time like so:
>
> tempstring = REREplace(tempstring, " ", "", "all")
> tempstring = REReplace(tempstring, "@", "", "all")
> etc
>
> but the # errors out.
>
> How can I do this in one pass,  if possible?
>
> Thanks for any and all help
>
>
>
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Regexp

2001-08-17 Thread Jordan Saardchit

heh... switch your function names you need REReplace if you are
pattern matching RegularExpressions.  In the source below, you are
trying to pattern match a regular expression with the normal replace
function.

-Original Message-
From: Bruce, Rodney [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 17, 2001 2:43 PM
To: CF-Talk
Subject: RE: Regexp


I must be missing something:  here is what I have,  trying to use a UDF.

The testing file name is ^@#$% $rt4o.txt 
When I run it through this code newfile is D:\documents\^@#$%$rt4o.txt
I left the space separate for testing,  the space is remove but none of
the
other chars are


Function removestrangechars(pagestring){

temppage = REReplaceNoCase(pagestring, " ", "", "all");
temppage = ReplaceNoCase(temppage, "[@##$%^&*()]", "",
"all");
return temppage;
}






#newfile#
 

thanks
rodney

-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 17, 2001 2:23 PM
To: CF-Talk
Subject: RE: Regexp


Since CF treats # as a variable marker, you have to escape it. Just use
##
to mean one #.

Also, instead of doing multiple REReplaces, use []s.

Ie, tempstring = REREplace(tempstring,"[ @##etc]","","ALL");

==Raymond Camden, 
Principal Spectra Compliance Engineer for Macromedia

Email   : [EMAIL PROTECTED]
ICQ UIN : 3679482

"My ally is the Force, and a powerful ally it is." - Yoda

> -Original Message-
> From: Bruce, Rodney [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 17, 2001 5:13 PM
> To: CF-Talk
> Subject: OT: Regexp
>
>
> I need help with a regexp.
>
> I am trying to remove all special chars from file names.
> I can remove them one at a time like so:
>
> tempstring = REREplace(tempstring, " ", "", "all")
> tempstring = REReplace(tempstring, "@", "", "all")
> etc
>
> but the # errors out.
>
> How can I do this in one pass,  if possible?
>
> Thanks for any and all help
>
>
>
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Regexp

2001-08-17 Thread Marlon Moyer

rereplace(tempString,"[^[:alnum:]]","","ALL")

Marlon

-Original Message-
From: Bruce, Rodney [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 17, 2001 4:13 PM
To: CF-Talk
Subject: OT: Regexp


I need help with a regexp.

I am trying to remove all special chars from file names.
I can remove them one at a time like so: 

tempstring = REREplace(tempstring, " ", "", "all") 
tempstring = REReplace(tempstring, "@", "", "all")
etc

but the # errors out.

How can I do this in one pass,  if possible?

Thanks for any and all help
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RegExp puzzle

2003-10-22 Thread LI, Chunshen \(Don\)
Hi,

Some RegExp expertise would be appreciated.

Goal: find nonstandard characters in the string no
matter where they appear.
Nonstandard characters include white space, %, # in
this case.



  output the whole str
  -- in this case, it should return the str 
	

Thanks.

Don Li

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




regexp help

2004-08-30 Thread chris porter
hi guys, heres a quick regexp question for ya.. i have this text (from an email and need a regex that will match the product info protions:

Here's the text: (might need to expand your window to see the full format)
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: RegExp Help

2003-03-26 Thread Neil Middleton
.*

I think, if not, nevermind...

Neil


> Can anyone help me with the RegExp for stripping out content 
> between two
> defined tags... ie
> 
> 
>   ...
>   Content to strip out
>   ...
> 
> 
> I would need it to strip out all the content and the tags 
> themselves as
> well...

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: RegExp Help

2003-03-26 Thread Jerry Johnson
What version of CF?
How long can the string be you are stripping it from?
By strip out, do you want the string returned without these tags in it? (As if you 
replaced them with "")
Are the these tags ever nested?

Jerry Johnson


>>> [EMAIL PROTECTED] 03/26/03 10:03AM >>>
Can anyone help me with the RegExp for stripping out content between two
defined tags... ie


...
Content to strip out
...


I would need it to strip out all the content and the tags themselves as
well...

TaInAdvance

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-26 Thread David Collie (itndac)
CF5 could be any length but for now won't be any longer than about
4000 characters.

The tags will not be nested and i would just like the RegExp to remove
the code between these tags and the tags themselves (As if you replaced
them with "", YES :-)

i appreciate any help as I am absolutely hopeless with RegExp and I know
there are experts on the list

-Original Message-
From: Jerry Johnson [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2003 15:03
To: CF-Talk
Subject: Re: RegExp Help


What version of CF?
How long can the string be you are stripping it from?
By strip out, do you want the string returned without these tags in it?
(As if you replaced them with "") Are the these tags ever nested?

Jerry Johnson


>>> [EMAIL PROTECTED] 03/26/03 10:03AM >>>
Can anyone help me with the RegExp for stripping out content between two
defined tags... ie


...
Content to strip out
...


I would need it to strip out all the content and the tags themselves as
well...

TaInAdvance


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-26 Thread David Collie (itndac)
Hi Neil,  Thanks for getting back to me... 

Your RegExp has done the trick well under it and really need to
brush up on my RegExp skills but am always put off by the horrible ones
you see getting used!

Much appreciated anyway :-)



-Original Message-
From: Neil Middleton [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2003 15:01
To: CF-Talk
Subject: RE: RegExp Help


.*

I think, if not, nevermind...

Neil


> Can anyone help me with the RegExp for stripping out content
> between two
> defined tags... ie
> 
> 
>   ...
>   Content to strip out
>   ...
> 
> 
> I would need it to strip out all the content and the tags
> themselves as
> well...


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-26 Thread Ben Doom
Can the  tags contain other tags?
Will there ever be more than one set in the page?
Will the tags ever take any parameters ie ?


--  Ben Doom
Programmer & General Lackey
Moonbow Software, Inc

: -Original Message-
: From: Jerry Johnson [mailto:[EMAIL PROTECTED]
: Sent: Wednesday, March 26, 2003 10:03 AM
: To: CF-Talk
: Subject: Re: RegExp Help
:
:
: What version of CF?
: How long can the string be you are stripping it from?
: By strip out, do you want the string returned without these tags
: in it? (As if you replaced them with "")
: Are the these tags ever nested?
:
: Jerry Johnson
:
:
: >>> [EMAIL PROTECTED] 03/26/03 10:03AM >>>
: Can anyone help me with the RegExp for stripping out content between two
: defined tags... ie
:
: 
:   ...
:   Content to strip out
:   ...
: 
:
: I would need it to strip out all the content and the tags themselves as
: well...
:
: TaInAdvance
:
: 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-26 Thread Neil Middleton
thats alright, thats about the only regexp I know..;-)

Neil


> Hi Neil,  Thanks for getting back to me... 
> 
> Your RegExp has done the trick well under it and really need to
> brush up on my RegExp skills but am always put off by the 
> horrible ones
> you see getting used!
> 
> Much appreciated anyway :-)

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-26 Thread Ben Doom
Just be aware that if you have a page like

Between the waves and the shore 
there's a boat here.

You'll get
Between  here.
not
Between  and the shore  here.

Because that regex will strip /everything/ between the /first/ open and the
/last/ close.  Which is why some of us are asking wierd questions about it.
:-)


--  Ben Doom
Programmer & General Lackey
Moonbow Software, Inc

: -Original Message-
: From: David Collie (itndac) [mailto:[EMAIL PROTECTED]
: Sent: Wednesday, March 26, 2003 10:25 AM
: To: CF-Talk
: Subject: RE: RegExp Help
:
:
: Hi Neil,  Thanks for getting back to me...
:
: Your RegExp has done the trick well under it and really need to
: brush up on my RegExp skills but am always put off by the horrible ones
: you see getting used!
:
: Much appreciated anyway :-)
:
:
:
: -Original Message-
: From: Neil Middleton [mailto:[EMAIL PROTECTED]
: Sent: 26 March 2003 15:01
: To: CF-Talk
: Subject: RE: RegExp Help
:
:
: .*
:
: I think, if not, nevermind...
:
: Neil
:
:
: > Can anyone help me with the RegExp for stripping out content
: > between two
: > defined tags... ie
: >
: > 
: > ...
: > Content to strip out
: > ...
: > 
: >
: > I would need it to strip out all the content and the tags
: > themselves as
: > well...
:
:
: 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-26 Thread David Collie (itndac)
FYI: The purpose was to rip out the HTML buttons of a report when
converting to PDF

Neil's RegExp did what I needed as I could guarantee that there would
only be one set on the page that surrounded the HTML code for the
buttons.  (Calling the report via CFHTTP so got it all in a variable to
run the RegExp on)

Ben & Jerry's questions do make me quite inquisitive as I am a bit
fearful of RegExp but I do realise that they could help me code so
much better... 

unfortunately... just dont have the time to learn it at the moment as
the Man has me working like crazy...

Anyway Cheers for your help everyone

PS anyone got any good resouces for learning RegExp?

-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2003 15:21
To: CF-Talk
Subject: RE: RegExp Help


Can the  tags contain other tags?
Will there ever be more than one set in the page?
Will the tags ever take any parameters ie ?


--  Ben Doom
Programmer & General Lackey
Moonbow Software, Inc

: -Original Message-
: From: Jerry Johnson [mailto:[EMAIL PROTECTED]
: Sent: Wednesday, March 26, 2003 10:03 AM
: To: CF-Talk
: Subject: Re: RegExp Help
:
:
: What version of CF?
: How long can the string be you are stripping it from?
: By strip out, do you want the string returned without these tags
: in it? (As if you replaced them with "")
: Are the these tags ever nested?
:
: Jerry Johnson
:
:
: >>> [EMAIL PROTECTED] 03/26/03 10:03AM >>>
: Can anyone help me with the RegExp for stripping out content between
two
: defined tags... ie
:
: 
:   ...
:   Content to strip out
:   ...
: 
:
: I would need it to strip out all the content and the tags themselves
as
: well...
:
: TaInAdvance
:
: 

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-26 Thread Jerry Johnson
You can't give up now just because its working!

Ben and I are chomping at the bit.

Can there be more than one of these sets of tags in the string?

(Neil's solution assumes 1 and only 1 set in the string)

Jerry Johnson

>>> [EMAIL PROTECTED] 03/26/03 10:24AM >>>
Hi Neil,  Thanks for getting back to me... 

Your RegExp has done the trick well under it and really need to
brush up on my RegExp skills but am always put off by the horrible ones
you see getting used!

Much appreciated anyway :-)



-Original Message-
From: Neil Middleton [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2003 15:01
To: CF-Talk
Subject: RE: RegExp Help


.*

I think, if not, nevermind...

Neil


> Can anyone help me with the RegExp for stripping out content
> between two
> defined tags... ie
> 
> 
>   ...
>   Content to strip out
>   ...
> 
> 
> I would need it to strip out all the content and the tags
> themselves as
> well...



~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-26 Thread Ben Doom
If you like books, I'd reccommend starting with the regex chapter of
Advanced Macromedia ColdFusion 5 Application Development by Ben Forta

However, that seems to assume that you already know a bit about regex and
just need to know about porting to CF5 POSIX-like syntax and the limitations
of the CF5 engine.  If you want to know more about regex in general, and
especially Javascript and Perlish (and therefore CFMXish) regex, I'd
reccommend
Mastering Regular Expressions from O'Reilly.

If you want something quick, easy, and interactive, I'd reccommend
http://www.houseoffusion.com/cf_lists/index.cfm?method=threads&forumid=21
for all your CF regex needs.  The ninjas are standing by.


--  Ben Doom
Programmer & General Lackey
Moonbow Software, Inc

: -Original Message-
: From: David Collie (itndac) [mailto:[EMAIL PROTECTED]
: Sent: Wednesday, March 26, 2003 10:34 AM
: To: CF-Talk
: Subject: RE: RegExp Help
:
:
: FYI: The purpose was to rip out the HTML buttons of a report when
: converting to PDF
:
: Neil's RegExp did what I needed as I could guarantee that there would
: only be one set on the page that surrounded the HTML code for the
: buttons.  (Calling the report via CFHTTP so got it all in a variable to
: run the RegExp on)
:
: Ben & Jerry's questions do make me quite inquisitive as I am a bit
: fearful of RegExp but I do realise that they could help me code so
: much better...
:
: unfortunately... just dont have the time to learn it at the moment as
: the Man has me working like crazy...
:
: Anyway Cheers for your help everyone
:
: PS anyone got any good resouces for learning RegExp?
:
: -Original Message-
: From: Ben Doom [mailto:[EMAIL PROTECTED]
: Sent: 26 March 2003 15:21
: To: CF-Talk
: Subject: RE: RegExp Help
:
:
: Can the  tags contain other tags?
: Will there ever be more than one set in the page?
: Will the tags ever take any parameters ie ?
:
:
: --  Ben Doom
: Programmer & General Lackey
: Moonbow Software, Inc
:
: : -Original Message-
: : From: Jerry Johnson [mailto:[EMAIL PROTECTED]
: : Sent: Wednesday, March 26, 2003 10:03 AM
: : To: CF-Talk
: : Subject: Re: RegExp Help
: :
: :
: : What version of CF?
: : How long can the string be you are stripping it from?
: : By strip out, do you want the string returned without these tags
: : in it? (As if you replaced them with "")
: : Are the these tags ever nested?
: :
: : Jerry Johnson
: :
: :
: : >>> [EMAIL PROTECTED] 03/26/03 10:03AM >>>
: : Can anyone help me with the RegExp for stripping out content between
: two
: : defined tags... ie
: :
: : 
: : ...
: : Content to strip out
: : ...
: : 
: :
: : I would need it to strip out all the content and the tags themselves
: as
: : well...
: :
: : TaInAdvance
: :
: :
:
: 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-26 Thread David Collie (itndac)
Hi all...

All right guys I actually do want to take it a bit further if you don't
mind... at the moment I only have one set of tags per page... but I was
starting to think I could use this all over the place and it would be
very handy...

How would you go about ensuring that it only stripped out between the
opening and closing tag (if there were multiple) and not the others as
and not get the mucked up answer as listed below by Ben

Cheers

PS Subscription to CF_RegExp has left my inbox. And yes, they did seem
like weird questions but I understand why now :-)

-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2003 15:29
To: CF-Talk
Subject: RE: RegExp Help


Just be aware that if you have a page like

Between the waves and the shore 
there's a boat here.

You'll get
Between  here.
not
Between  and the shore  here.

Because that regex will strip /everything/ between the /first/ open and
the /last/ close.  Which is why some of us are asking wierd questions
about it.
:-)


--  Ben Doom
Programmer & General Lackey
Moonbow Software, Inc

: -Original Message-
: From: David Collie (itndac) [mailto:[EMAIL PROTECTED]
: Sent: Wednesday, March 26, 2003 10:25 AM
: To: CF-Talk
: Subject: RE: RegExp Help
:
:
: Hi Neil,  Thanks for getting back to me...
:
: Your RegExp has done the trick well under it and really need to
: brush up on my RegExp skills but am always put off by the horrible
ones
: you see getting used!
:
: Much appreciated anyway :-)
:
:
:
: -Original Message-
: From: Neil Middleton [mailto:[EMAIL PROTECTED]
: Sent: 26 March 2003 15:01
: To: CF-Talk
: Subject: RE: RegExp Help
:
:
: .*
:
: I think, if not, nevermind...
:
: Neil
:
:
: > Can anyone help me with the RegExp for stripping out content
: > between two
: > defined tags... ie
: >
: > 
: > ...
: > Content to strip out
: > ...
: > 
: >
: > I would need it to strip out all the content and the tags
: > themselves as
: > well...
:
:
: 

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-26 Thread Ben Doom
The easy answer (for me) is to upgrade to CFMX, which allows "non-greedy"
matches, which are intended to do exactly that.

If you really need to do this, I'd use refind() to locate each instance of
the beginning and ending tags and loop over that, removing them as I find
them.

HTH

--  Ben Doom
Programmer & General Lackey
Moonbow Software, Inc

: -Original Message-
: From: David Collie (itndac) [mailto:[EMAIL PROTECTED]
: Sent: Wednesday, March 26, 2003 11:17 AM
: To: CF-Talk
: Subject: RE: RegExp Help
:
:
: Hi all...
:
: All right guys I actually do want to take it a bit further if you don't
: mind... at the moment I only have one set of tags per page... but I was
: starting to think I could use this all over the place and it would be
: very handy...
:
: How would you go about ensuring that it only stripped out between the
: opening and closing tag (if there were multiple) and not the others as
: and not get the mucked up answer as listed below by Ben
:
: Cheers
:
: PS Subscription to CF_RegExp has left my inbox. And yes, they did seem
: like weird questions but I understand why now :-)
:
: -Original Message-
: From: Ben Doom [mailto:[EMAIL PROTECTED]
: Sent: 26 March 2003 15:29
: To: CF-Talk
: Subject: RE: RegExp Help
:
:
: Just be aware that if you have a page like
:
: Between the waves and the shore 
: there's a boat here.
:
: You'll get
: Between  here.
: not
: Between  and the shore  here.
:
: Because that regex will strip /everything/ between the /first/ open and
: the /last/ close.  Which is why some of us are asking wierd questions
: about it.
: :-)
:
:
: --  Ben Doom
: Programmer & General Lackey
: Moonbow Software, Inc
:
: : -Original Message-
: : From: David Collie (itndac) [mailto:[EMAIL PROTECTED]
: : Sent: Wednesday, March 26, 2003 10:25 AM
: : To: CF-Talk
: : Subject: RE: RegExp Help
: :
: :
: : Hi Neil,  Thanks for getting back to me...
: :
: : Your RegExp has done the trick well under it and really need to
: : brush up on my RegExp skills but am always put off by the horrible
: ones
: : you see getting used!
: :
: : Much appreciated anyway :-)
: :
: :
: :
: : -Original Message-
: : From: Neil Middleton [mailto:[EMAIL PROTECTED]
: : Sent: 26 March 2003 15:01
: : To: CF-Talk
: : Subject: RE: RegExp Help
: :
: :
: : .*
: :
: : I think, if not, nevermind...
: :
: : Neil
: :
: :
: : > Can anyone help me with the RegExp for stripping out content
: : > between two
: : > defined tags... ie
: : >
: : > 
: : >   ...
: : >   Content to strip out
: : >   ...
: : > 
: : >
: : > I would need it to strip out all the content and the tags
: : > themselves as
: : > well...
: :
: :
: :
:
: 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-26 Thread David Collie (itndac)
No CFMX upgrade for a while unfortunately, will look into the refind (if
I get time!)

Cheers to Neil, Jerry and Ben, much appreciated 

-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2003 16:30
To: CF-Talk
Subject: RE: RegExp Help


The easy answer (for me) is to upgrade to CFMX, which allows
"non-greedy" matches, which are intended to do exactly that.

If you really need to do this, I'd use refind() to locate each instance
of the beginning and ending tags and loop over that, removing them as I
find them.

HTH

--  Ben Doom
Programmer & General Lackey
Moonbow Software, Inc

: -Original Message-
: From: David Collie (itndac) [mailto:[EMAIL PROTECTED]
: Sent: Wednesday, March 26, 2003 11:17 AM
: To: CF-Talk
: Subject: RE: RegExp Help
:
:
: Hi all...
:
: All right guys I actually do want to take it a bit further if you
don't
: mind... at the moment I only have one set of tags per page... but I
was
: starting to think I could use this all over the place and it would be
: very handy...
:
: How would you go about ensuring that it only stripped out between the
: opening and closing tag (if there were multiple) and not the others as
: and not get the mucked up answer as listed below by Ben
:
: Cheers
:
: PS Subscription to CF_RegExp has left my inbox. And yes, they did seem
: like weird questions but I understand why now :-)
:
: -Original Message-
: From: Ben Doom [mailto:[EMAIL PROTECTED]
: Sent: 26 March 2003 15:29
: To: CF-Talk
: Subject: RE: RegExp Help
:
:
: Just be aware that if you have a page like
:
: Between the waves and the shore

: there's a boat here.
:
: You'll get
: Between  here.
: not
: Between  and the shore  here.
:
: Because that regex will strip /everything/ between the /first/ open
and
: the /last/ close.  Which is why some of us are asking wierd questions
: about it.
: :-)
:
:
: --  Ben Doom
: Programmer & General Lackey
: Moonbow Software, Inc
:
: : -Original Message-
: : From: David Collie (itndac) [mailto:[EMAIL PROTECTED]
: : Sent: Wednesday, March 26, 2003 10:25 AM
: : To: CF-Talk
: : Subject: RE: RegExp Help
: :
: :
: : Hi Neil,  Thanks for getting back to me...
: :
: : Your RegExp has done the trick well under it and really need to
: : brush up on my RegExp skills but am always put off by the horrible
: ones
: : you see getting used!
: :
: : Much appreciated anyway :-)
: :
: :
: :
: : -Original Message-
: : From: Neil Middleton [mailto:[EMAIL PROTECTED]
: : Sent: 26 March 2003 15:01
: : To: CF-Talk
: : Subject: RE: RegExp Help
: :
: :
: : .*
: :
: : I think, if not, nevermind...
: :
: : Neil
: :
: :
: : > Can anyone help me with the RegExp for stripping out content
: : > between two
: : > defined tags... ie
: : >
: : > 
: : >   ...
: : >   Content to strip out
: : >   ...
: : > 
: : >
: : > I would need it to strip out all the content and the tags
: : > themselves as
: : > well...
: :
: :
: :
:
: 

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-26 Thread Jerry Johnson
It is nothing.

This is not good code. I haven't really looked through it lately. Don't learn 
programming practice from it.

With that said, I think this shows how to use find to remove tags and (optionally) 
content






">











",tstr,tnext+1)>






















#tstr#
#result#


>>> [EMAIL PROTECTED] 03/26/03 12:04PM >>>
No CFMX upgrade for a while unfortunately, will look into the refind (if
I get time!)

Cheers to Neil, Jerry and Ben, much appreciated 

-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2003 16:30
To: CF-Talk
Subject: RE: RegExp Help


The easy answer (for me) is to upgrade to CFMX, which allows
"non-greedy" matches, which are intended to do exactly that.

If you really need to do this, I'd use refind() to locate each instance
of the beginning and ending tags and loop over that, removing them as I
find them.

HTH

--  Ben Doom
Programmer & General Lackey
Moonbow Software, Inc

: -Original Message-
: From: David Collie (itndac) [mailto:[EMAIL PROTECTED] 
: Sent: Wednesday, March 26, 2003 11:17 AM
: To: CF-Talk
: Subject: RE: RegExp Help
:
:
: Hi all...
:
: All right guys I actually do want to take it a bit further if you
don't
: mind... at the moment I only have one set of tags per page... but I
was
: starting to think I could use this all over the place and it would be
: very handy...
:
: How would you go about ensuring that it only stripped out between the
: opening and closing tag (if there were multiple) and not the others as
: and not get the mucked up answer as listed below by Ben
:
: Cheers
:
: PS Subscription to CF_RegExp has left my inbox. And yes, they did seem
: like weird questions but I understand why now :-)
:
: -Original Message-
: From: Ben Doom [mailto:[EMAIL PROTECTED] 
: Sent: 26 March 2003 15:29
: To: CF-Talk
: Subject: RE: RegExp Help
:
:
: Just be aware that if you have a page like
:
: Between the waves and the shore

: there's a boat here.
:
: You'll get
: Between  here.
: not
: Between  and the shore  here.
:
: Because that regex will strip /everything/ between the /first/ open
and
: the /last/ close.  Which is why some of us are asking wierd questions
: about it.
: :-)
:
:
: --  Ben Doom
: Programmer & General Lackey
: Moonbow Software, Inc
:
: : -Original Message-
: : From: David Collie (itndac) [mailto:[EMAIL PROTECTED] 
: : Sent: Wednesday, March 26, 2003 10:25 AM
: : To: CF-Talk
: : Subject: RE: RegExp Help
: :
: :
: : Hi Neil,  Thanks for getting back to me...
: :
: : Your RegExp has done the trick well under it and really need to
: : brush up on my RegExp skills but am always put off by the horrible
: ones
: : you see getting used!
: :
: : Much appreciated anyway :-)
: :
: :
: :
: : -Original Message-
: : From: Neil Middleton [mailto:[EMAIL PROTECTED] 
: : Sent: 26 March 2003 15:01
: : To: CF-Talk
: : Subject: RE: RegExp Help
: :
: :
: : .*
: :
: : I think, if not, nevermind...
: :
: : Neil
: :
: :
: : > Can anyone help me with the RegExp for stripping out content
: : > between two
: : > defined tags... ie
: : >
: : > 
: : >   ...
: : >   Content to strip out
: : >   ...
: : > 
: : >
: : > I would need it to strip out all the content and the tags
: : > themselves as
: : > well...
: :
: :
: :
:
: 


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-26 Thread Jerry Johnson
And this is a simple replace and regex combo.
(This replace the end tag with a (hopefully) unused character, which should be much 
easier to find than the endtag string)





","ø","ALL")>



#tstr#
#tstr2#




Jerry


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: RegExp Help

2003-03-28 Thread David Collie (itndac)
Hi Jerry, was out the office yesterday [coder sees the light of day
shock] and just wanted to say cheers for the help after my last post

Good pointers in what I am needing to do in your code samples thanks
:-)


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: CFINPUT & RegExp

2003-01-27 Thread Bryan F. Hogan
Hi Gerry remove the first character and the last character and re-run it.


Bryan F. Hogan
Director of Internet Development
Macromedia Certified ColdFusion MX Developer
Digital Bay Media, Inc.
1-877-72DIGITAL


-Original Message-
From: Gerry Pauline [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 2:39 PM
To: CF-Talk
Subject: CFINPUT & RegExp


CFxperts:

I'm using CFFORM to create an online survey for a user. In one of the
CFINPUT tags, I'm using a regular express to validate an entry. I coded
the VALIDATE= and PATTERN= parms as follows:

 

The text should contain three numeric quadrants delimited by hyphens,
for example: 1000-909-1033. As you may guess, it doesn't seem to be
working. According to the manual, a JavaScript regular expression should
be used, which I believe is specified correctly.

The CFFORM tag is coded as follows:



As you can see, it calls another JS function in addition to using the
builtin valadation features of the CFINPUT tag. The other tags using the
CFINPUT validation calls all work OK (only the tag above uses a regular
expression).

Could someone please advise me on what I'm doing wrong (besides being
lazy and using CFFORM in the first place !). Any and all
advise/suggestions/help will be gratefully appreciated !

Thank you.

-Gerry

Gerard T. Pauline
Mgr, Internet Applications
Computer Systems, DoIT
Pace University

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4




RE: CFINPUT & RegExp

2003-01-27 Thread Bryan F. Hogan
replace your pattern="/^\d{4}\-\d{3}\-\d{4}$/"

with pattern="^\d{4}\-\d{3}\-\d{4}$"


Bryan F. Hogan
Director of Internet Development
Macromedia Certified ColdFusion MX Developer
Digital Bay Media, Inc.
1-877-72DIGITAL


-Original Message-
From: Bryan F. Hogan [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 2:46 PM
To: CF-Talk
Subject: RE: CFINPUT & RegExp


Hi Gerry remove the first character and the last character and re-run it.


Bryan F. Hogan
Director of Internet Development
Macromedia Certified ColdFusion MX Developer
Digital Bay Media, Inc.
1-877-72DIGITAL


-Original Message-
From: Gerry Pauline [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 2:39 PM
To: CF-Talk
Subject: CFINPUT & RegExp


CFxperts:

I'm using CFFORM to create an online survey for a user. In one of the
CFINPUT tags, I'm using a regular express to validate an entry. I coded
the VALIDATE= and PATTERN= parms as follows:

 

The text should contain three numeric quadrants delimited by hyphens,
for example: 1000-909-1033. As you may guess, it doesn't seem to be
working. According to the manual, a JavaScript regular expression should
be used, which I believe is specified correctly.

The CFFORM tag is coded as follows:



As you can see, it calls another JS function in addition to using the
builtin valadation features of the CFINPUT tag. The other tags using the
CFINPUT validation calls all work OK (only the tag above uses a regular
expression).

Could someone please advise me on what I'm doing wrong (besides being
lazy and using CFFORM in the first place !). Any and all
advise/suggestions/help will be gratefully appreciated !

Thank you.

-Gerry

Gerard T. Pauline
Mgr, Internet Applications
Computer Systems, DoIT
Pace University


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4




RE: CFINPUT & RegExp

2003-01-27 Thread Ben Doom
I think what you're looking for might be
^\d{4}-\d{3}-\d{4}$
but, to be honest, I've not done much with JS regexes.

As always, check out the RegEx list at http://www.houseoffusion.com for more
help.  Many regex ninjas on call there.  :-)


--  Ben Doom
Programmer & General Lackey
Moonbow Software, Inc

: -Original Message-
: From: Gerry Pauline [mailto:[EMAIL PROTECTED]]
: Sent: Monday, January 27, 2003 2:39 PM
: To: CF-Talk
: Subject: CFINPUT & RegExp
:
:
: CFxperts:
:
: I'm using CFFORM to create an online survey for a user. In one of the
: CFINPUT tags, I'm using a regular express to validate an entry. I coded
: the VALIDATE= and PATTERN= parms as follows:
:
:  
:
: The text should contain three numeric quadrants delimited by hyphens,
: for example: 1000-909-1033. As you may guess, it doesn't seem to be
: working. According to the manual, a JavaScript regular expression should
: be used, which I believe is specified correctly.
:
: The CFFORM tag is coded as follows:
:
: 
:
: As you can see, it calls another JS function in addition to using the
: builtin valadation features of the CFINPUT tag. The other tags using the
: CFINPUT validation calls all work OK (only the tag above uses a regular
: expression).
:
: Could someone please advise me on what I'm doing wrong (besides being
: lazy and using CFFORM in the first place !). Any and all
: advise/suggestions/help will be gratefully appreciated !
:
: Thank you.
:
: -Gerry
:
: Gerard T. Pauline
: Mgr, Internet Applications
: Computer Systems, DoIT
: Pace University
: 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4




Re: CFINPUT & RegExp

2003-01-27 Thread Gerry Pauline
Bryan:

Thank you, you nailed it ! I knew it was going to be something stupid !
I removed the slash delimiters and it worked as desired. 

Thank you for taking the time to help out, it is much appreciated !

-Gerry

Gerard T. Pauline
Mgr, Internet Applications
Computer Systems, DoIT
Pace University


"Bryan F. Hogan" wrote:
> 
> replace your pattern="/^\d{4}\-\d{3}\-\d{4}$/"
> 
> with pattern="^\d{4}\-\d{3}\-\d{4}$"
> 
> 
> Bryan F. Hogan
> Director of Internet Development
> Macromedia Certified ColdFusion MX Developer
> Digital Bay Media, Inc.
> 1-877-72DIGITAL
> 
> 
> -Original Message-
> From: Bryan F. Hogan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 27, 2003 2:46 PM
> To: CF-Talk
> Subject: RE: CFINPUT & RegExp
> 
> Hi Gerry remove the first character and the last character and re-run it.
> 
> 
> Bryan F. Hogan
> Director of Internet Development
> Macromedia Certified ColdFusion MX Developer
> Digital Bay Media, Inc.
> 1-877-72DIGITAL
> 
> 
> -Original Message-
> From: Gerry Pauline [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 27, 2003 2:39 PM
> To: CF-Talk
> Subject: CFINPUT & RegExp
> 
> CFxperts:
> 
> I'm using CFFORM to create an online survey for a user. In one of the
> CFINPUT tags, I'm using a regular express to validate an entry. I coded
> the VALIDATE= and PATTERN= parms as follows:
> 
>SIZE="40"
> MAXLENGTH="13"
>  VALIDATE="regular_expression"
>   PATTERN="/^\d{4}\-\d{3}\-\d{4}$/"
>  NAME="BudgetNo"
>  REQUIRED="Yes"
>   MESSAGE="Please enter your BUDGET NUMBER !">
> 
> The text should contain three numeric quadrants delimited by hyphens,
> for example: 1000-909-1033. As you may guess, it doesn't seem to be
> working. According to the manual, a JavaScript regular expression should
> be used, which I believe is specified correctly.
> 
> The CFFORM tag is coded as follows:
> 
>METHOD="POST"
>   ACTION="TASurveyToDB.CFM"
> ONSUBMIT="return chkForm()">
> 
> As you can see, it calls another JS function in addition to using the
> builtin valadation features of the CFINPUT tag. The other tags using the
> CFINPUT validation calls all work OK (only the tag above uses a regular
> expression).
> 
> Could someone please advise me on what I'm doing wrong (besides being
> lazy and using CFFORM in the first place !). Any and all
> advise/suggestions/help will be gratefully appreciated !
> 
> Thank you.
> 
> -Gerry
> 
> Gerard T. Pauline
> Mgr, Internet Applications
> Computer Systems, DoIT
> Pace University
> 
> 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4




RE: CFINPUT & RegExp

2003-01-27 Thread Bryan F. Hogan
Your welcome, It's only because I just did this myself friday. :)


Bryan F. Hogan
Director of Internet Development
Macromedia Certified ColdFusion MX Developer
Digital Bay Media, Inc.
1-877-72DIGITAL


-Original Message-
From: Gerry Pauline [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 4:39 PM
To: CF-Talk
Subject: Re: CFINPUT & RegExp


Bryan:

Thank you, you nailed it ! I knew it was going to be something stupid !
I removed the slash delimiters and it worked as desired.

Thank you for taking the time to help out, it is much appreciated !

-Gerry

Gerard T. Pauline
Mgr, Internet Applications
Computer Systems, DoIT
Pace University


"Bryan F. Hogan" wrote:
>
> replace your pattern="/^\d{4}\-\d{3}\-\d{4}$/"
>
> with pattern="^\d{4}\-\d{3}\-\d{4}$"
>
> 
> Bryan F. Hogan
> Director of Internet Development
> Macromedia Certified ColdFusion MX Developer
> Digital Bay Media, Inc.
> 1-877-72DIGITAL
> 
>
> -Original Message-
> From: Bryan F. Hogan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 27, 2003 2:46 PM
> To: CF-Talk
> Subject: RE: CFINPUT & RegExp
>
> Hi Gerry remove the first character and the last character and re-run it.
>
> 
> Bryan F. Hogan
> Director of Internet Development
> Macromedia Certified ColdFusion MX Developer
> Digital Bay Media, Inc.
> 1-877-72DIGITAL
> 
>
> -Original Message-
> From: Gerry Pauline [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 27, 2003 2:39 PM
> To: CF-Talk
> Subject: CFINPUT & RegExp
>
> CFxperts:
>
> I'm using CFFORM to create an online survey for a user. In one of the
> CFINPUT tags, I'm using a regular express to validate an entry. I coded
> the VALIDATE= and PATTERN= parms as follows:
>
>SIZE="40"
> MAXLENGTH="13"
>  VALIDATE="regular_expression"
>   PATTERN="/^\d{4}\-\d{3}\-\d{4}$/"
>  NAME="BudgetNo"
>  REQUIRED="Yes"
>   MESSAGE="Please enter your BUDGET NUMBER !">
>
> The text should contain three numeric quadrants delimited by hyphens,
> for example: 1000-909-1033. As you may guess, it doesn't seem to be
> working. According to the manual, a JavaScript regular expression should
> be used, which I believe is specified correctly.
>
> The CFFORM tag is coded as follows:
>
>METHOD="POST"
>   ACTION="TASurveyToDB.CFM"
> ONSUBMIT="return chkForm()">
>
> As you can see, it calls another JS function in addition to using the
> builtin valadation features of the CFINPUT tag. The other tags using the
> CFINPUT validation calls all work OK (only the tag above uses a regular
> expression).
>
> Could someone please advise me on what I'm doing wrong (besides being
> lazy and using CFFORM in the first place !). Any and all
> advise/suggestions/help will be gratefully appreciated !
>
> Thank you.
>
> -Gerry
>
> Gerard T. Pauline
> Mgr, Internet Applications
> Computer Systems, DoIT
> Pace University
>
>

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4




Re: RegExp Help

2002-03-20 Thread Jerry Johnson

]*>(.*).*","\1")>

(or something like that)

Jerry Johnson

>>> [EMAIL PROTECTED] 03/20/02 01:10PM >>>
Anyone Have a RegExp to get all content between the  tags? I found a
UDF that parses out the , but I'm trying to modify it to parse out
the  instead, but I'm not having much luck.

Any help would be greatly appreciated.

mike wallick
* web application developer
* [EMAIL PROTECTED] 
* 651.628.5377
*  http://www.securecomputing.com 



__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: RegExp Help

2002-03-20 Thread Wallick, Mike

You rock! That does exactly what I need it to do.

Thanks Jerry

Mike

-Original Message-
From: Jerry Johnson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 1:13 PM
To: CF-Talk
Subject: Re: RegExp Help


]*>(.*).*","\1")>

(or something like that)

Jerry Johnson

>>> [EMAIL PROTECTED] 03/20/02 01:10PM >>>
Anyone Have a RegExp to get all content between the  tags? I found a
UDF that parses out the , but I'm trying to modify it to parse out
the  instead, but I'm not having much luck.

Any help would be greatly appreciated.

mike wallick
* web application developer
* [EMAIL PROTECTED] 
* 651.628.5377
*  http://www.securecomputing.com 




__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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



REReplace and RegExp

2002-04-22 Thread Troy Simpson

Dear CF-Talkers:

I have a string in the following format( I've added carriage returns for
readability):

Bruggen, Coosje van,
b.1942' &
'Berger, Patrick, b.
1947'
>

I want to process the string to look like this (replace the AGENT tags with
ANCHOR tags):

Bruggen, Coosje van, b.1942' &
'Berger, Patrick, b. 1947'
>

I have somewhat accomplished this like so but still need some work and have
become a little lost.

REReplaceNoCase(
agent,

'(.*)?',
' \4 ',
"ALL")>

**Another problem is that the AGENT Attributes can be in any order which
really throughs wrench into things.

Anyone have any advise on how to approach this?
I would really appreciated it.

Thanks,
Troy


--
Troy Simpson
Applications Analyst/Programmer - MCSE, OCP-DBA
North Carolina State University Libraries
Campus Box 7111 | Raleigh | North Carolina
ph.919.515.3855 | fax.919.513.3330
[EMAIL PROTECTED]

__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



[OT] - RegExp Help

2003-12-09 Thread A.Little
Hi all,

I'm trying to write a regular _expression_ and am having a little
trouble... What I want to do is replace all instances of '/document.cfm'
in a string with '/public/document.cfm', unless the original substring
is '/public/document.cfm' - ie I don't want to end up with
'/public/public/document.cfm'.

This is what I;ve been trying:
#ReReplace('.open.ac.uk/document.cfm>test','(^public)/document.cfm','/pu
blic/document.cfm')#

But in this instance it's not finding a match, so not replacing the
required substring - can anyone give me any pointers as to where I;ve
gone wrong? I found plenty of examples about Reg Exp generally, but none
which seem to fit what I'm trying to achieve.

Thanks,

Alex
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: RegExp Help

2002-05-23 Thread Gyrus

- Original Message -
From: "Wallick, Mike" <[EMAIL PROTECTED]>
Hey all. I'm trying to cook up a regexp to search a block of text for
links.
What I'm looking for is something like:



I want to read the block of text and replace spaces with %20 so links
won't
break.
---

Try this:


  


I don't know why you have to loop around until they're all replaced - I
thought setting the scope of REReplaceNoCase to 'ALL' would do that.
Well, this is where *my* knowledge of regexps falls over! Maybe someone
else can clear this up?

Anyway, the regexp itself seems to work. A plain English translation:

Match http://www.tengai.co.uk
play: http://www.norlonto.net
- PGP key available


__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
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



RE: RegExp Help

2002-05-23 Thread Matthew Walker

Nobody seems to have replied, so here goes

You don't want to use (.*) as regexes are greedy and will try to match
the biggest string possible. If you have to s in a block, this regex
will match from the start of one to the end of the other. 

", "", "all")>

This will only replace one space per anchor. You need to run it
repeatedly to get them all.

Regards, 
Matthew Walker 
/* 
Easier, smarter forms:
http://www.matthewwalker.net.nz/inform2 
*/ 




> -Original Message-
> From: Wallick, Mike [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 24 May 2002 3:24 a.m.
> To: CF-Talk
> Subject: RegExp Help
> 
> 
> Hey all. I'm trying to cook up a regexp to search a block of 
> text for links.
> What I'm looking for is something like:
>  
> 
>  
> I want to read the block of text and replace spaces with %20 
> so links won't
> break. I know, I know, links shouldn't have spaces in them, 
> but this is
> something I inherited and changing all the links and 
> filenames associated
> with them is not an option (there are thousands of links/files).
>  
> I've tried this:  href="(.*)">',
> '', "all")>
>  
> and this:  href="(.*)">', ' href="#Replace(\1, " ", "%20"))#">', "all")>
>  
> and those don't work. Can I not use CFML functions on a 
> regexp subexpression
> (\1) ?
>  
> I'm not exactly an expert on regexps, so any help would be greatly
> appreciated.
>  
> 
>  
> 
> Mike Wallick
> 
> 
> 
> 
> Web Application Developer
> 
> 
> 
> 
> [EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]> 
> 
> 
> 
> 
> 651.628.5377
> 
> 
> 
> 
> http://www.securecomputing.com <http://www.securecomputing.com/> 
> 
>  
> 
>  
> 
> 
__
Get the mailserver that powers this list at http://www.coolfusion.com
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



Re: RegExp Help

2002-05-24 Thread Gyrus

- Original Message -
From: "Matthew Walker" <[EMAIL PROTECTED]>

", "", "all")>

This will only replace one space per anchor. You need to run it
repeatedly to get them all.
-

I ended up with a similar solution in replying to the original poster -
with a conditional loop wrapped around it running REFind with the same
regexp.

Just curious: do you know why you have to loop around, even with the
"ALL" scope set in REReplace? What's the point of the "ALL" bit?

- Gyrus


- [EMAIL PROTECTED]
work: http://www.tengai.co.uk
play: http://www.norlonto.net
- PGP key available


__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
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



Re: RegExp Help

2002-05-24 Thread Matthew Walker

BTW After I posted this I realised you had in fact already replied - d'oh!

The problem is that the regex engine works thru the content character by
character. It seems like if it finds a match from character x to character
y, it will move on to x + 1. Is this right?

- Original Message -
From: "Gyrus" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 2:40 AM
Subject: Re: RegExp Help


> - Original Message -
> From: "Matthew Walker" <[EMAIL PROTECTED]>
>
>  ([^""]*)"">", "", "all")>
>
> This will only replace one space per anchor. You need to run it
> repeatedly to get them all.
> -
>
> I ended up with a similar solution in replying to the original poster -
> with a conditional loop wrapped around it running REFind with the same
> regexp.
>
> Just curious: do you know why you have to loop around, even with the
> "ALL" scope set in REReplace? What's the point of the "ALL" bit?
>
> - Gyrus
>
> 
> - [EMAIL PROTECTED]
> work: http://www.tengai.co.uk
> play: http://www.norlonto.net
> - PGP key available
> 
>
> 
__
Get the mailserver that powers this list at http://www.coolfusion.com
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



RE: Regexp help

2001-07-17 Thread Raymond Camden

Are you talking about UDFs? I have a custom tag that will scan a UDF library
for UDFs and either generate HTML docs or return a structure. If you want
the code, let me know. It's going to be downloadable once CFLib.org gets
relaunched this week, but I can send you a copy now if you would like.

===
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email   : [EMAIL PROTECTED]
ICQ UIN : 3679482

"My ally is the Force, and a powerful ally it is." - Yoda

> -Original Message-
> From: Bryan LaPlante [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 17, 2001 5:00 PM
> To: CF-Talk
> Subject: Regexp help
>
>
> I need some help from one of the RegExp guru's. I am trying to
> get a list of
> function names from my page for example the following functions
> name resides
> in the page at position 9 to 17. I need a regular expression that
> will find
> everything between the word function and the parenthesis
> character ( so that
> I can get the word addition into a list. Here is what I have so far.
>
>  \(",thistag.generatedcontent,1,true)>
>
> function addition(a,b){
> somevar = a + b;
> return somevar;
> }
>
> Bryan LaPlante
>
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Regexp help

2001-07-17 Thread Dick Applebaum

Assuming the test containing the source is a variable named text.
the following will return a comma-delimited list of function names






HTH

Dick



At 3:59 PM -0500 7/17/01, Bryan LaPlante wrote:
>I need some help from one of the RegExp guru's. I am trying to get a list of
>function names from my page for example the following functions name resides
>in the page at position 9 to 17. I need a regular expression that will find
>everything between the word function and the parenthesis character ( so that
>I can get the word addition into a list. Here is what I have so far.
>
>\(",thistag.generatedcontent,1,true)>
>
>function addition(a,b){
>somevar = a + b;
>return somevar;
>}
>
>Bryan LaPlante
>
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Regexp help

2001-07-17 Thread Marlon Moyer

refindnocase("(function)(.)([[:graph::]]*)\(",thistag.generatedcontent,1,tru
e)>

Marlon

-Original Message-
From: Bryan LaPlante [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 17, 2001 4:00 PM
To: CF-Talk
Subject: Regexp help


I need some help from one of the RegExp guru's. I am trying to get a list of
function names from my page for example the following functions name resides
in the page at position 9 to 17. I need a regular expression that will find
everything between the word function and the parenthesis character ( so that
I can get the word addition into a list. Here is what I have so far.



function addition(a,b){
somevar = a + b;
return somevar;
}

Bryan LaPlante
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Regexp help

2001-07-17 Thread Dick Applebaum

Oops, wrap problems... try:

Assuming the test containing the source is a variable named text.
the following will return a comma-delimited list of function names






HTH

Dick



At 3:59 PM -0500 7/17/01, Bryan LaPlante wrote:
>I need some help from one of the RegExp guru's. I am trying to get a list of
>function names from my page for example the following functions name resides
>in the page at position 9 to 17. I need a regular expression that will find
>everything between the word function and the parenthesis character ( so that
>I can get the word addition into a list. Here is what I have so far.
>
>\(",thistag.generatedcontent,1,true)>
>
>function addition(a,b){
>somevar = a + b;
>return somevar;
>}
>
>Bryan LaPlante
>
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Regexp help

2001-07-17 Thread Sicular, Alexander

how do i go about using these results?

after running your regex, i imagine you get a structure returned whose keys
are len and pos. you could then use those in the mid function to retrieve
the string. however, when i run:








#key#:: #regextestvar[key]#




i get:

Error Diagnostic Information

 Expression result cannot be converted to a string

 Expressions used inside tags like CFOUTPUT, CFQUERY, CFMAIL, etc. must
evaluate to a value that can be converted to a string for output or dynamic
text accumulation purposes. Complex objects,
 such as queries, arrays, and COM/DCOM objects, cannot be represented as
strings.

?

-Original Message-
From: Marlon Moyer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 17, 2001 7:24 PM
To: CF-Talk
Subject: RE: Regexp help


refindnocase("(function)(.)([[:graph::]]*)\(",thistag.generatedcontent,1,tru
e)>

Marlon

-Original Message-
From: Bryan LaPlante [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 17, 2001 4:00 PM
To: CF-Talk
Subject: Regexp help


I need some help from one of the RegExp guru's. I am trying to get a list of
function names from my page for example the following functions name resides
in the page at position 9 to 17. I need a regular expression that will find
everything between the word function and the parenthesis character ( so that
I can get the word addition into a list. Here is what I have so far.



function addition(a,b){
somevar = a + b;
return somevar;
}

Bryan LaPlante
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: OT: Regexp

2001-08-17 Thread Stuart Duncan


Try [[:punct:]]

That gets rid of punctuation... anything that's not letters or numbers 
basically.

tempstring = REReplace(tempstring, "[[:punct:]]", "", "all")


Stuart Duncan
MaracasMedia Inc.


At 02:12 PM 8/17/01 -0700, you wrote:
>I need help with a regexp.
>
>I am trying to remove all special chars from file names.
>I can remove them one at a time like so:
>
>tempstring = REREplace(tempstring, " ", "", "all")
>tempstring = REReplace(tempstring, "@", "", "all")
>etc
>
>but the # errors out.
>
>How can I do this in one pass,  if possible?
>
>Thanks for any and all help
>
>
>
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: OT: Regexp

2001-08-17 Thread Dick Applebaum

Try:

   tempstring = REREplaceNoCase(tempstring, "[^A-Z_]", "", "all")

HTH

Dick

At 2:12 PM -0700 8/17/01, Bruce, Rodney wrote:
>I need help with a regexp.
>
>I am trying to remove all special chars from file names.
>I can remove them one at a time like so:
>
>tempstring = REREplace(tempstring, " ", "", "all")
>tempstring = REReplace(tempstring, "@", "", "all")
>etc
>
>but the # errors out.
>
>How can I do this in one pass,  if possible?
>
>Thanks for any and all help

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: OT: Regexp

2001-08-17 Thread Dick Applebaum

Misread the questionb... shoukd have been:

   tempstring = REReplaceNoCase(tempstring, "[^A-Z0-9_]", "", "all")


>Try:
>
>tempstring = REREplaceNoCase(tempstring, "[^A-Z_]", "", "all")
>
>HTH
>
>Dick
>
>At 2:12 PM -0700 8/17/01, Bruce, Rodney wrote:
>  >I need help with a regexp.
>  >
>  >I am trying to remove all special chars from file names.
>  >I can remove them one at a time like so:
>  >
>  >tempstring = REREplace(tempstring, " ", "", "all")
>  >tempstring = REReplace(tempstring, "@", "", "all")
>  >etc
>  >
>  >but the # errors out.
>  >
>  >How can I do this in one pass,  if possible?
>  >
>  >Thanks for any and all help
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



More regexp madness

2001-12-27 Thread Kay Smoljak

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 - . 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:



My text block is in a var called #attributes.bodytext#. I then try to
remove the above string like this:



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.
__
Why Share?
  Dedicated Win 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=coldfusionc
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



Quick regexp help

2001-12-31 Thread Kay Smoljak

I wonder if there's anyone around who can help me with this... It's
driving me crazy. I want a regexp to find a pattern starting with "" and replace it with
"\b " (RTF markup).

I have tried doing this, but it's not working:

]*>","\b ","ALL")> 

Anyone?
K.
__
Why Share?
  Dedicated Win 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=coldfusionc
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



RegExp help needed

2002-01-08 Thread Jeff Beer

Hello all,

I have a text file that's a save of a bunch of messages from Outlook.  The
messages are error reports from CF sent with CFMail.  The formatting sucks -
I never expected to get a bunch - I was using it for debugging.. anyway, I
have several hundred I need to parse.  Silly transaction logs

The layout is below.  What I need to do is get the datetime string and the
message ID from each instance of an error message in that file so I can
update our database.

 start 'record' -

x:\inetpub\domain\subdir\errorfile.cfm

DateTime: {ts '2002-01-06 00:44:09'}

URL Message_ID: 23660 


Message: ODBC Error Code = 37000 (Syntax error or 
access
violation)
Detail: [Microsoft][ODBC SQL Server Driver][SQL 
Server]The log file for
database 'dsdb' is full. Back up the transaction log for the database to
free up some log space.

 end 'record' -

The file has this format several hundred times over.

Reading it in with cffile is simple.  What I can't figure out is how to
write the pattern matching code to extract the two variables.  Also, the
logic to make sure I have matching pairs is pretty easy - it's just the
RegExps that are killing me.

This is probably simple; I could write this in Perl but can't seem to do it
in CF.

Thanks in advance,

Jeff
__
Why Share?
  Dedicated Win 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=coldfusionc
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



RE: RegExp puzzle

2003-10-22 Thread Matthew Walker


This will succeed if any white space, %, or # is found. Is that what you
want? Watch

-Original Message-
From: LI, Chunshen (Don) [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 23 October 2003 3:46 p.m.
To: CF-Talk
Subject: RegExp puzzle

Hi,

Some RegExp expertise would be appreciated.

Goal: find nonstandard characters in the string no
matter where they appear.
Nonstandard characters include white space, %, # in
this case.



  output the whole str
  -- in this case, it should return the str 
 

Thanks.

Don Li

  _  


 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: RegExp puzzle

2003-10-22 Thread LI, Chunshen \(Don\)
Great. Then would this [EMAIL PROTECTED] read:
find everything other than A through Z, a through z,
0 through 9, and @, and %, and $
?

Thanks.

Don Li

--- Matthew Walker <[EMAIL PROTECTED]> wrote:
> 
> 
>  
> 
> This will succeed if any white space, %, or # is
> found. Is that what you
> want? Watch
> 
>  
> 
> -Original Message-
> From: LI, Chunshen (Don) [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, 23 October 2003 3:46 p.m.
> To: CF-Talk
> Subject: RegExp puzzle
> 
>  
> 
> Hi,
> 
> Some RegExp expertise would be appreciated.
> 
> Goal: find nonstandard characters in the string no
> matter where they appear.
> Nonstandard characters include white space, %, # in
> this case.
> 
> 
> 
>   output the whole str
>   -- in this case, it should return the str 
>  
> 
> Thanks.
> 
> Don Li
> 
> 
> 
>   _  
> 
> 
>

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: RegExp puzzle

2003-10-22 Thread Matthew Walker
Yes. You can use the posix class: [:alnum:] if you like.

[^[:alnum:[EMAIL PROTECTED]

-Original Message-
From: LI, Chunshen (Don) [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 23 October 2003 4:14 p.m.
To: CF-Talk
Subject: RE: RegExp puzzle

Great. Then would this [EMAIL PROTECTED] read:
find everything other than A through Z, a through z,
0 through 9, and @, and %, and $
?

Thanks.

Don Li

--- Matthew Walker <[EMAIL PROTECTED]> wrote:
> 
> 
>  
> 
> This will succeed if any white space, %, or # is
> found. Is that what you
> want? Watch
> 
>  
> 
> -Original Message-
> From: LI, Chunshen (Don) [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, 23 October 2003 3:46 p.m.
> To: CF-Talk
> Subject: RegExp puzzle
> 
>  
> 
> Hi,
> 
> Some RegExp expertise would be appreciated.
> 
> Goal: find nonstandard characters in the string no
> matter where they appear.
> Nonstandard characters include white space, %, # in
> this case.
> 
> 
> 
>   output the whole str
>   -- in this case, it should return the str 
>  
> 
> Thanks.
> 
> Don Li
> 
> 
> 
>   _  
> 
> 
>

  _  


 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: RegExp puzzle

2003-10-23 Thread Pascal Peters
What you are saying with the regexp is that you want to match all
characters except:

 
letters, numbers and _ @ % $ (these are your valid characters)

 
As your string only contains valid characters (see above), the 
block will not execute. Your original regexp would have the same result.
-Original Message-
From: Chunshen (Don) Li [mailto:[EMAIL PROTECTED] 
Sent: donderdag 23 oktober 2003 16:13
To: CF-Talk
Subject: Re:RegExp puzzle

Almost there.  Now, I see why initially I was confused.  Initially, the
RegExp syntax like [EMAIL PROTECTED] was in SQL STMT, and I simply copied
it to CF without realizing the fact that CF's implementation of RegExp
differs from that of SQL (in MS SQL Server case)
.

the ^[:alnum:] part works in the following REfind function while
the [EMAIL PROTECTED] part not.  Do you know why?  I'm on CF6.0 for 
Windows.



...





 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: RegExp puzzle

2003-10-23 Thread Pascal Peters

-Original Message-
From: Chunshen (Don) Li [mailto:[EMAIL PROTECTED] 
Sent: donderdag 23 oktober 2003 16:36
To: CF-Talk
Subject: Re:RegExp puzzle

Sorry, I haven't made my question clear in the beginning.  The goal is,
to skip letters and numbers, find/match/see if a string that contains
any of the following characters:
_, @, %, $ and white space.




 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: RegExp puzzle

2003-10-23 Thread [EMAIL PROTECTED]
I think you can just negate Pascal's regexp using the ^ symbol.

[EMAIL PROTECTED]:space:]]

Give that a whirl see if it works.

I have a love hate relationship with RegExps,  I love the thought of them
but I hate using them *L*

-Darren

-Original Message-
From: Pascal Peters [mailto:[EMAIL PROTECTED]
Sent: 23 October 2003 15:53
To: CF-Talk
Subject: RE: RegExp puzzle


-Original Message-
From: Chunshen (Don) Li [mailto:[EMAIL PROTECTED] 
Sent: donderdag 23 oktober 2003 16:36
To: CF-Talk
Subject: Re:RegExp puzzle

Sorry, I haven't made my question clear in the beginning.  The goal is,
to skip letters and numbers, find/match/see if a string that contains
any of the following characters:
_, @, %, $ and white space.




 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: regexp help

2004-08-30 Thread Michael Dinowitz
Remember that the list removes all text that comes after a line of dashes.
You may want to repost that text you want to parse. On the other hand, your
in luck as I just finished another email parser to grab products out of an
email for entry into a DB (for mothernature.com). I should be able to help.

  _  


hi guys, heres a quick regexp question for ya.. i have this text (from an
email and need a regex that will match the product info protions:

Here's the text: (might need to expand your window to see the full format) 
  _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: regexp help

2004-08-30 Thread chris porter
Hmm got bit by that lines problem... good advanced warning that that will happen ;)

here is the text:
Product Name
Product NumberQty  Est. Ship Date Your Ext. Price
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: regexp help

2004-08-30 Thread chris porter
and one last time

DATA:

Product Name
Product NumberQty  Est. Ship Date Your Ext. Price
[dashed go here all the way across PITA email parser]

description of some item1
0344437 1   03/12/2004 USD    335.75

another description of some item1
0344734 1   03/12/2004 USD    335.75

and one last description of some item
0433447 1   03/12/2004 USD    335.75


part i need parsed by a regex

"description of some item1
0344437 1   03/12/2004 USD    335.75"

current REGEX:
([0-9]+)[ ]+([0-9]+)[ ]+([^ ]+)[ ]+([A-Z]{3})[ ]+([0-9.]+)

that regex matches everything on the 2nd line correctly, but nothing i add to the beginning will match the first line. any thoughts?

Thanks!
-Chris
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: regexp help

2004-08-30 Thread Michael Dinowitz
OK, lets do the pattern dance. The product name will always be on it's own
line and followed by the product info? What is the number format (if any).
What can it contain (spaces, dashes, etc.). Is the quantity always there?
Ship date always there? in any specific format? Price always there? Always
in price format? If there's a specific pattern to the data (which there
should be), then you can have a fast and easy RegEx to parse it all in no
time.

  _  

Hmm got bit by that lines problem... good advanced warning that that will
happen ;)

here is the text:
Product Name
Product NumberQty  Est. Ship Date Your Ext.
Price 
  _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: regexp help

2004-08-30 Thread Michael Dinowitz
Really fast (Using the multi-line move of CFMX)

 
^([^#chr(13)#]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]{2
}/[0-9]{2}/[0-9]{4})[[:space:]]+(USD)?[[:space:]]*([0-9.]+)$

  _  

From: chris porter [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 30, 2004 4:41 PM
To: CF-Talk
Subject: Re: regexp help

and one last time

DATA:

Product Name
Product NumberQty  Est. Ship Date Your Ext.
Price
[dashed go here all the way across PITA email parser]

description of some item1
0344437 1   03/12/2004 USD
335.75

another description of some item1
0344734 1   03/12/2004 USD
335.75

and one last description of some item
0433447 1   03/12/2004 USD
335.75

part i need parsed by a regex

"description of some item1
0344437 1   03/12/2004 USD
335.75"

current REGEX:
([0-9]+)[ ]+([0-9]+)[ ]+([^ ]+)[ ]+([A-Z]{3})[ ]+([0-9.]+)

that regex matches everything on the 2nd line correctly, but nothing i add
to the beginning will match the first line. any thoughts?

Thanks!
-Chris 
  _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: regexp help

2004-08-30 Thread Ian Sheridan
Why don;t you just go through the text as a list with CR as the
delimiter? This way you can have much more focused regular
expressions.

Just a thought,

Ian

- Original Message -
From: Michael Dinowitz <[EMAIL PROTECTED]>
Date: Mon, 30 Aug 2004 16:49:48 -0400
Subject: RE: regexp help
To: CF-Talk <[EMAIL PROTECTED]>

Really fast (Using the multi-line move of CFMX)

^([^#chr(13)#]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]{2
 }/[0-9]{2}/[0-9]{4})[[:space:]]+(USD)?[[:space:]]*([0-9.]+)$

 
   _  

 From: chris porter [mailto:[EMAIL PROTECTED] 
 Sent: Monday, August 30, 2004 4:41 PM
 To: CF-Talk
 Subject: Re: regexp help

and one last time

 DATA:

 Product Name
 Product NumberQty  Est. Ship Date Your Ext.
 Price
 [dashed go here all the way across PITA email parser]

 description of some item1
 0344437 1   03/12/2004 USD
 335.75

 another description of some item1
 0344734 1   03/12/2004 USD
 335.75

 and one last description of some item
 0433447 1   03/12/2004 USD
 335.75

 part i need parsed by a regex

 "description of some item1
 0344437 1   03/12/2004 USD
 335.75"

 current REGEX:
 ([0-9]+)[ ]+([0-9]+)[ ]+([^ ]+)[ ]+([A-Z]{3})[ ]+([0-9.]+)

 that regex matches everything on the 2nd line correctly, but nothing i add
 to the beginning will match the first line. any thoughts?

 Thanks!
 -Chris 
   _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: regexp help

2004-08-30 Thread Michael Dinowitz
You can get the first and second lines based on a new line delimited list
and you can get the items in the second line using a space delimited list. I
just like to be specific when parsing data from a source like email. My
preference is to pop 2 messages, save the first in a DB (raw) and use the
second as a flag to rerun the page. Once all the mail is down and stored in
the DB (one at a time, there's a reason), I have a second process parse each
message in the tightest way possible. I'm paranoid (as all programmers
should be) about data from outside sources and I want to be 100% sure of
what I'm getting and how. If there's a problem, then I want to know exactly
what's up. 

  _  

Why don;t you just go through the text as a list with CR as the
delimiter? This way you can have much more focused regular
expressions.

Just a thought,

Ian

- Original Message -
From: Michael Dinowitz <[EMAIL PROTECTED]>
Date: Mon, 30 Aug 2004 16:49:48 -0400
Subject: RE: regexp help
To: CF-Talk <[EMAIL PROTECTED]>

Really fast (Using the multi-line move of CFMX)

^([^#chr(13)#]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]{2
}/[0-9]{2}/[0-9]{4})[[:space:]]+(USD)?[[:space:]]*([0-9.]+)$

   _  

From: chris porter [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 30, 2004 4:41 PM
To: CF-Talk
Subject: Re: regexp help

and one last time

DATA:

Product Name
Product NumberQty  Est. Ship Date Your Ext.
Price
[dashed go here all the way across PITA email parser]

description of some item1
0344437 1   03/12/2004 USD
335.75

another description of some item1
0344734 1   03/12/2004 USD
335.75

and one last description of some item
0433447 1   03/12/2004 USD
335.75

part i need parsed by a regex

"description of some item1
0344437 1   03/12/2004 USD
335.75"

current REGEX:
([0-9]+)[ ]+([0-9]+)[ ]+([^ ]+)[ ]+([A-Z]{3})[ ]+([0-9.]+)

that regex matches everything on the 2nd line correctly, but nothing i add
to the beginning will match the first line. any thoughts?

Thanks!
-Chris
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: regexp help

2004-08-30 Thread Ian Sheridan
I understand that, what I meant was, wouldn't it be easier to parse
each line separately? This way you do not need to have such a highly
complicated RegEx. You can make it much more simple and a little bit
more flexible. Not to mention easier to maintain. (i.e. two separate
regular expressions or more)


   email = emailFromServer; // focused down to the body content only
   n = listlen(email,chr(13) & chr(32));
   output = arraynew(1);
   output[1] = structnew();
   a = arraynew(2);
   a[1][1] = "RegEx";
   a[1][2] = "description";
   a[2][1] = "RegEx";
   a[2][2] = "productnumber";
   nn = arraylen(a); // regex count
   nnn = 1; // record count
   c = 0; // field count
   for (i=1:i LTE n;i=i+1) {
  currentitem = listgetat(email,i,chr(13) & chr(32));
  for (ii=1;ii LTE nn;ii=ii+1) {
 if (refind(a[i][1],currentitem)) {
output[nnn]['#a[i][2]#'] = trim(currentitem);
if (c GT 5) {
   c = 0;
   nnn = nnn + 1;
   output[nnn] = structnew();
} else {
   c = c +1;
}
 }
  }
   }


heh I went a little crazy here but I pretty sure this would work. Any
future changes on what each feild would hold would be easy to change.
(beware I did not test it)

Ian

- Original Message -
From: Michael Dinowitz <[EMAIL PROTECTED]>
Date: Mon, 30 Aug 2004 18:23:04 -0400
Subject: RE: regexp help
To: CF-Talk <[EMAIL PROTECTED]>

You can get the first and second lines based on a new line delimited list
 and you can get the items in the second line using a space delimited list. I
 just like to be specific when parsing data from a source like email. My
 preference is to pop 2 messages, save the first in a DB (raw) and use the
 second as a flag to rerun the page. Once all the mail is down and stored in
 the DB (one at a time, there's a reason), I have a second process parse each
 message in the tightest way possible. I'm paranoid (as all programmers
 should be) about data from outside sources and I want to be 100% sure of
 what I'm getting and how. If there's a problem, then I want to know exactly
 what's up. 

 
   _  

Why don;t you just go through the text as a list with CR as the
 delimiter? This way you can have much more focused regular
 expressions.

 Just a thought,

 Ian

 - Original Message -----
 From: Michael Dinowitz <[EMAIL PROTECTED]>
 Date: Mon, 30 Aug 2004 16:49:48 -0400
 Subject: RE: regexp help
 To: CF-Talk <[EMAIL PROTECTED]>

 Really fast (Using the multi-line move of CFMX)

 ^([^#chr(13)#]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]{2
 }/[0-9]{2}/[0-9]{4})[[:space:]]+(USD)?[[:space:]]*([0-9.]+)$

 
    _  

 From: chris porter [mailto:[EMAIL PROTECTED] 
 Sent: Monday, August 30, 2004 4:41 PM
 To: CF-Talk
 Subject: Re: regexp help

 and one last time

 DATA:

 Product Name
 Product NumberQty  Est. Ship Date Your Ext.
 Price
 [dashed go here all the way across PITA email parser]

 description of some item1
 0344437 1   03/12/2004 USD
 335.75

 another description of some item1
 0344734 1   03/12/2004 USD
 335.75

 and one last description of some item
 0433447 1   03/12/2004 USD
 335.75

 part i need parsed by a regex

 "description of some item1
 0344437 1   03/12/2004 USD
 335.75"

 current REGEX:
 ([0-9]+)[ ]+([0-9]+)[ ]+([^ ]+)[ ]+([A-Z]{3})[ ]+([0-9.]+)

 that regex matches everything on the 2nd line correctly, but nothing i add
 to the beginning will match the first line. any thoughts?

 Thanks!
 -Chris
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: regexp help

2004-08-30 Thread chris porter
hmm that didnt provide a match in either the example i sent, or the actual data.. did you verrify it first? also how are you loading the regex? i was just using reFindNoCase() maybe there's a better way. I do like where you are going with the first part of your regex though. Its similar to what i origionally tried:

^([^\n\r]+)[\n\r]+([0-9]+)[ ]+([0-9]+)[ ]+([^ ]+)[ ]+([A-Z]{3})[ ]+([0-9.]+)
and
^([^\n\r]+)([0-9]+)[ ]+([0-9]+)[ ]+([^ ]+)[ ]+([A-Z]{3})[ ]+([0-9.]+)

i would think that the ^  would anchor to the beginning of a line (like its supposed to), ([^\n\r]+) would find an entire line of text (since the _expression_ reads "as many characters that are not newline or return") and [\n\r]+ match the CRLF at the end, then the rest of the working regex (its a mess so i wont paste that part in) would kick in. it then occured to me that it was possible that by using the [^\n\r] it possibly was providing a match on those characters, and therefore the next [\n\r]+ wouldnt find a match as the parser had already passed them during the previous find, so i removed the [\n\r]+ but still no love ( and in fact that theory is wrong, the parser stops at the invalid characters and tests those against the next part of the _expression_). so there is something not happening that i'm missing.

also, i appreciate the changing of the working regex but a couple of things to note here (and also some wise info for newbies out there):
1) the USD is the country code of the currency, and is not optional and wont alwasy be USD, therefore hard refrencing with "(USD)?" doesn't really make the regex work in all cases in fact, if the country code were GBP the optional specifier would fail (since USD was not found), and the pattern would fail because there wouldnt be anything to handle the 3 unhandled characters that were actually there.
2) while the regex used for the date is great, the requirement isnt for date validation here, just field delimitation. this is mainly because we cannot controll the format the data is being received in and as such, we wont know if the date is 10-06-78 or Oct-06-78 etc etc. i'd need to change the regex again to accomodate that. a much simpler and accurate way to parse that section is to just look for the next space ([^ ]+) and let the sql date parser or createODBCdate() take care of it.

anyways back to the topic at hand, what else am i missing at the beginning..? any thoughts anyone?
Thanks
-Chris

>Really fast (Using the multi-line move of CFMX)
> 
>^([^#chr(13)#]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]{2
>}/[0-9]{2}/[0-9]{4})[[:space:]]+(USD)?[[:space:]]*([0-9.]+)$
>
>  _  
>
>From: chris porter [mailto:[EMAIL PROTECTED] 
>Sent: Monday, August 30, 2004 4:41 PM
>To: CF-Talk
>Subject: Re: regexp help
>
>
>and one last time
>
>DATA:
>
>Product Name
>Product NumberQty  Est. Ship Date Your Ext.
>Price
>[dashed go here all the way across PITA email parser]
>
>description of some item1
>0344437 1   03/12/2004 USD
>335.75
>
>another description of some item1
>0344734 1   03/12/2004 USD
>335.75
>
>and one last description of some item
>0433447 1   03/12/2004 USD
>335.75
>
>
>part i need parsed by a regex
>
>"description of some item1
>0344437 1   03/12/2004 USD
>335.75"
>
>current REGEX:
>([0-9]+)[ ]+([0-9]+)[ ]+([^ ]+)[ ]+([A-Z]{3})[ ]+([0-9.]+)
>
>that regex matches everything on the 2nd line correctly, but nothing i add
>to the beginning will match the first line. any thoughts?
>
>Thanks!
>-Chris 
>  _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: regexp help

2004-08-30 Thread chris porter
that was an option i explored, however these emails arent coming from just one source, in fact there are hundreds of different company emails coming in, so my options were, either 1) define the data i need, and specify a regex to grab it, then database the expressions, or 2) write a custom script in code that can identify each one of those possibly by regex. personally i opted for option a cause i can always fine tune an _expression_, but changing code gets tedious.

on another note, what distinguishes the item description line during a line by line scan from something like

"this is just a confirmation email."

get my drift?
-chris

>I understand that, what I meant was, wouldn't it be easier to parse
>each line separately? This way you do not need to have such a highly
>complicated RegEx. You can make it much more simple and a little bit
>more flexible. Not to mention easier to maintain. (i.e. two separate
>regular expressions or more)
>
>
>   email = emailFromServer; // focused down to the body content only
>   n = listlen(email,chr(13) & chr(32));
>   output = arraynew(1);
>   output[1] = structnew();
>   a = arraynew(2);
>   a[1][1] = "RegEx";
>   a[1][2] = "description";
>   a[2][1] = "RegEx";
>   a[2][2] = "productnumber";
>   nn = arraylen(a); // regex count
>   nnn = 1; // record count
>   c = 0; // field count
>   for (i=1:i LTE n;i=i+1) {
>  currentitem = listgetat(email,i,chr(13) & chr(32));
>  for (ii=1;ii LTE nn;ii=ii+1) {
> if (refind(a[i][1],currentitem)) {
>output[nnn]['#a[i][2]#'] = trim(currentitem);
>if (c GT 5) {
>   c = 0;
>   nnn = nnn + 1;
>   output[nnn] = structnew();
>} else {
>   c = c +1;
>}
> }
>  }
>   }
>
>
>heh I went a little crazy here but I pretty sure this would work. Any
>future changes on what each feild would hold would be easy to change.
>(beware I did not test it)
>
>Ian
>
>
>- Original Message -
>From: Michael Dinowitz <[EMAIL PROTECTED]>
>Date: Mon, 30 Aug 2004 18:23:04 -0400
>Subject: RE: regexp help
>To: CF-Talk <[EMAIL PROTECTED]>
>
>You can get the first and second lines based on a new line delimited list
> and you can get the items in the second line using a space delimited list. I
> just like to be specific when parsing data from a source like email. My
> preference is to pop 2 messages, save the first in a DB (raw) and use the
> second as a flag to rerun the page. Once all the mail is down and stored in
> the DB (one at a time, there's a reason), I have a second process parse each
> message in the tightest way possible. I'm paranoid (as all programmers
> should be) about data from outside sources and I want to be 100% sure of
> what I'm getting and how. If there's a problem, then I want to know exactly
> what's up. 
> 
>   _  
>
>
> 
> Why don;t you just go through the text as a list with CR as the
> delimiter? This way you can have much more focused regular
> expressions.
> 
> Just a thought,
> 
> Ian
> 
> - Original Message -
> From: Michael Dinowitz <[EMAIL PROTECTED]>
> Date: Mon, 30 Aug 2004 16:49:48 -0400
> Subject: RE: regexp help
> To: CF-Talk <[EMAIL PROTECTED]>
> 
> Really fast (Using the multi-line move of CFMX)
> 
> ^([^#chr(13)#]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]{2
> }/[0-9]{2}/[0-9]{4})[[:space:]]+(USD)?[[:space:]]*([0-9.]+)$
> 
>    _  
> 
> From: chris porter [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 30, 2004 4:41 PM
> To: CF-Talk
> Subject: Re: regexp help
> 
> and one last time
> 
> DATA:
> 
> Product Name
> Product NumberQty  Est. Ship Date Your Ext.
> Price
> [dashed go here all the way across PITA email parser]
> 
> description of some item1
> 0344437 1   03/12/2004 USD
> 335.75
> 
> another description of some item1
> 0344734 1   03/12/2004 USD
> 335.75
> 
> and one last description of some item
> 0433447 1   03/12/2004 USD
> 335.75
> 
> part i need parsed by a regex
> 
> "description of some item1
> 0344437 1   03/12/2004 USD
> 335.75"
> 
> current REGEX:
> ([0-9]+)[ ]+([0-9]+)[ ]+([^ ]+)[ ]+([A-Z]{3})[ ]+([0-9.]+)
> 
> that regex matches everything on the 2nd line correctly, but nothing i add
> to the beginning will match the first line. any thoughts?
> 
> Thanks!
> -Chris
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: regexp help

2004-08-30 Thread Ian Sheridan
heh after talk'n out of my but this should work for you

([[:alnum:] ]+)\r\s*([0-9]{7})\s*([0-9]+)\s*([0-3][0-9]/[0-1][0-9]/[0-9]{4})\s*([A-Z]{2,3})\s*([0-9]+\.[0-9]{2})

You have to add some of your own business logic to not parse the "this
is just a confirmation email" emails. I do not know all the codes that
you are using with the USD codes so I left it like this: [A-Z]{2,3}

I just hope that I have helped somewhere.

Ian

- Original Message -
From: chris porter <[EMAIL PROTECTED]>
Date: Mon, 30 Aug 2004 21:40:53 -0400
Subject: Re: regexp help
To: CF-Talk <[EMAIL PROTECTED]>

that was an option i explored, however these emails arent coming from
just one source, in fact there are hundreds of different company
emails coming in, so my options were, either 1) define the data i
need, and specify a regex to grab it, then database the expressions,
or 2) write a custom script in code that can identify each one of
those possibly by regex. personally i opted for option a cause i can
always fine tune an _expression_, but changing code gets tedious.

 on another note, what distinguishes the item description line during
a line by line scan from something like

 "this is just a confirmation email."

 get my drift?
 -chris

>I understand that, what I meant was, wouldn't it be easier to parse
 >each line separately? This way you do not need to have such a highly
 >complicated RegEx. You can make it much more simple and a little bit
 >more flexible. Not to mention easier to maintain. (i.e. two separate
 >regular expressions or more)
 >
 >
 >   email = emailFromServer; // focused down to the body content only
 >   n = listlen(email,chr(13) & chr(32));
 >   output = arraynew(1);
 >   output[1] = structnew();
 >   a = arraynew(2);
 >   a[1][1] = "RegEx";
 >   a[1][2] = "description";
 >   a[2][1] = "RegEx";
 >   a[2][2] = "productnumber";
 >   nn = arraylen(a); // regex count
 >   nnn = 1; // record count
 >   c = 0; // field count
 >   for (i=1:i LTE n;i=i+1) {
 >  currentitem = listgetat(email,i,chr(13) & chr(32));
 >  for (ii=1;ii LTE nn;ii=ii+1) {
 > if (refind(a[i][1],currentitem)) {
 >output[nnn]['#a[i][2]#'] = trim(currentitem);
 >if (c GT 5) {
 >   c = 0;
 >   nnn = nnn + 1;
 >   output[nnn] = structnew();
 >} else {
 >   c = c +1;
 >}
 > }
 >  }
 >   }
 >
 >
 >heh I went a little crazy here but I pretty sure this would work. Any
 >future changes on what each feild would hold would be easy to change.
 >(beware I did not test it)
 >
 >Ian
 >
 >
 >- Original Message -
 >From: Michael Dinowitz <[EMAIL PROTECTED]>
 >Date: Mon, 30 Aug 2004 18:23:04 -0400
 >Subject: RE: regexp help
 >To: CF-Talk <[EMAIL PROTECTED]>
 >
 >You can get the first and second lines based on a new line delimited list
 > and you can get the items in the second line using a space delimited list. I
 > just like to be specific when parsing data from a source like email. My
 > preference is to pop 2 messages, save the first in a DB (raw) and use the
 > second as a flag to rerun the page. Once all the mail is down and stored in
 > the DB (one at a time, there's a reason), I have a second process parse each
 > message in the tightest way possible. I'm paranoid (as all programmers
 > should be) about data from outside sources and I want to be 100% sure of
 > what I'm getting and how. If there's a problem, then I want to know exactly
 > what's up. 
 > 
 >   _  
 >
 >
 > 
 > Why don;t you just go through the text as a list with CR as the
 > delimiter? This way you can have much more focused regular
 > expressions.
 > 
 > Just a thought,
 > 
 > Ian
 > 
 > - Original Message -
 > From: Michael Dinowitz <[EMAIL PROTECTED]>
 > Date: Mon, 30 Aug 2004 16:49:48 -0400
 > Subject: RE: regexp help
 > To: CF-Talk <[EMAIL PROTECTED]>
 > 
 > Really fast (Using the multi-line move of CFMX)
 > 
 > ^([^#chr(13)#]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9]{2
 > }/[0-9]{2}/[0-9]{4})[[:space:]]+(USD)?[[:space:]]*([0-9.]+)$
 > 
 >    _  
 > 
 > From: chris porter [mailto:[EMAIL PROTECTED] 
 > Sent: Monday, August 30, 2004 4:41 PM
 > To: CF-Talk
 > Subject: Re: regexp help
 > 
 > and one last time
 > 
 > DATA:
 > 
 > Product Name
 > Product NumberQty  Est. Ship Date Your Ext.
 > Price
 > [dashed go here all the way across PITA email parser]
 > 
 > description of some item1
 > 0344437 1

Re: regexp help

2004-08-31 Thread chris porter
:) well that regex didn't produce a match unfortunately.. however i was just looking at this & thinking man this is screwey.. maybe the \r isnt required for some odd reason. so i revised the regex to read:
([[:alnum:]]+)\r?\s*([0-9]+)[ ]+([0-9]+)[ ]+([^ ]+)[ ]+([A-Z]{3})[ ]+([0-9.]+)

and got a match! but it was on: "item1 0344437 1 03/12/2004 USD 335.75"
so the next important thing is to add a space to the :alnum: list and bam! i got the full match. so with the regex revised to:
([[:alnum:] ]+)\r?\s*([0-9]+)[ ]+([0-9]+)[ ]+([^ ]+)[ ]+([A-Z]{3})[ ]+([0-9.]+)

i get the match i needed wich is: "description of some item1 0344437 1 03/12/2004 USD 335.75"

its still not quite perfect, but hey, its matching & thats the important part!!

Thanks for your help!!
-chris

> heh after talk'n out of my but this should work for you
> 
> ([[:alnum:] 
]+)\r> \s*([0-9]{7})\s*([0-9]+)\s*([0-3][0-9]/[0-1][0-9]/[0-9]{4})\s*([A-Z]{2,
> 3})\s*([0-9]+\.[0-9]{2})
> 
> You have to add some of your own business logic to not parse the 
> "this
> is just a confirmation email" emails. I do not know all the codes 
> that
> you are using with the USD codes so I left it like this: [A-Z]{2,3}
> 
> I just hope that I have helped somewhere.
> 
> Ian

 
> 
> 
> - Original Message -
> From: chris porter <[EMAIL PROTECTED]>
> Date: Mon, 30 Aug 2004 21:40:53 -0400
> Subject: Re: regexp help
> To: CF-Talk <[EMAIL PROTECTED]>
> 
> that was an option i explored, however these emails arent coming from
> just one source, in fact there are hundreds of different company
> emails coming in, so my options were, either 1) define the data i
> need, and specify a regex to grab it, then database the expressions,
> or 2) write a custom script in code that can identify each one of
> those possibly by regex. personally i opted for option a cause i can
> always fine tune an _expression_, but changing code gets tedious.

 
> 

 
> on another note, what distinguishes the item description line during
> a line by line scan from something like

 
> 

 
> "this is just a confirmation email."

 
> 

 
> get my drift?

 
> -chris
> 
> 

 
> 

 
> >I understand that, what I meant was, wouldn't it be easier to parse

 
> >each line separately? This way you do not need to have such a highly

 
> >complicated RegEx. You can make it much more simple and a little bit

 
> >more flexible. Not to mention easier to maintain. (i.e. two separate

 
> >regular expressions or more)

 
> >

 
> >

 
> >   email = emailFromServer; // focused down to the body content only

 
> >   n = listlen(email,chr(13) & chr(32));

 
> >   output = arraynew(1);

 
> >   output[1] = structnew();

 
> >   a = arraynew(2);

 
> >   a[1][1] = "RegEx";

 
> >   a[1][2] = "description";

 
> >   a[2][1] = "RegEx";

 
> >   a[2][2] = "productnumber";

 
> >   nn = arraylen(a); // regex count

 
> >   nnn = 1; // record count

 
> >   c = 0; // field count

 
> >   for (i=1:i LTE n;i=i+1) {

 
> >  currentitem = listgetat(email,i,chr(13) & chr(32));

 
> >  for (ii=1;ii LTE nn;ii=ii+1) {

 
> > if (refind(a[i][1],currentitem)) {

 
> >output[nnn]['#a[i][2]#'] = trim(currentitem);

 
> >if (c GT 5) {

 
> >   c = 0;

 
> >   nnn = nnn + 1;

 
> >   output[nnn] = structnew();

 
> >} else {

 
> >   c = c +1;

 
> >    }

 
> > }

 
> >  }

 
> >   }

 
> >

 
> >

 
> >heh I went a little crazy here but I pretty sure this would work. 
> Any

 
> >future changes on what each feild would hold would be easy to change.
> 

 
> >(beware I did not test it)

 
> >

 
> >Ian

 
> >

 
> >

 
> >- Original Message -

 
> >From: Michael Dinowitz <[EMAIL PROTECTED]>

 
> >Date: Mon, 30 Aug 2004 18:23:04 -0400

 
> >Subject: RE: regexp help

 
> >To: CF-Talk <[EMAIL PROTECTED]>

 
> >

 
> >You can get the first and second lines based on a new line delimited 
> list

 
> > and you can get the items in the second line using a space delimited 
> list. I

 
> > just like to be specific when parsing data from a source like email. 
> My

 
> > preference is to pop 2 messages, save the first in a DB (raw) and 
> use the

 
> > second as a flag to rerun the page. Once all the mail is down and 
> stored in

 
> > the DB (one at a time, there's a reason), I have a second pr

Help With RegEXp.

2005-03-28 Thread David Manriquez
i need to remove some tags from HTML like inputs , images, selects ans scripts

i test the RegExp in Visual REgEXP 3.0 and works .. but not in Coldfusion.

Any tip?..

How i can test RegExp for Coldfusion?

Mi code :

","","ALL")>
","","ALL")>
.+","","ALL")>
.+","","ALL")>

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200198
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: REReplace and RegExp

2002-04-22 Thread James Ang

Try this:

REReplaceNoCase(agents, "(|[[:space:]]+[^>]*>)",
"\1a\2", "ALL")

I have tested this code on CFAS 5 on WinXP.

James Ang
Senior Programmer
MedSeek, Inc.


-Original Message-
From: Troy Simpson [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 22, 2002 2:15 PM
To: CF-Talk
Subject: REReplace and RegExp


Dear CF-Talkers:

I have a string in the following format( I've added carriage returns for
readability):

Bruggen, Coosje van, b.1942' & 'Berger, Patrick, b.
1947'
>

I want to process the string to look like this (replace the AGENT tags
with ANCHOR tags):

Bruggen, Coosje van, b.1942' &
'Berger, Patrick, b. 1947'
>

I have somewhat accomplished this like so but still need some work and
have become a little lost.

REReplaceNoCase(
agent,

'(.*)?',
' \4 ',
"ALL")>

**Another problem is that the AGENT Attributes can be in any order which
really throughs wrench into things.

Anyone have any advise on how to approach this?
I would really appreciated it.

Thanks,
Troy


--
Troy Simpson
Applications Analyst/Programmer - MCSE, OCP-DBA
North Carolina State University Libraries
Campus Box 7111 | Raleigh | North Carolina
ph.919.515.3855 | fax.919.513.3330
[EMAIL PROTECTED]


__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
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



RE: REReplace and RegExp

2002-04-22 Thread James Ang

Actually, this looks like a UDF candidate for cflib.org. Ray Camden?

I don't have time to format it nicely for cflib.org. Anyone wants to
volunteer? :)

// Assuming that strFind and strReplace has no RegExp characters that
need to be escaped
// else, someone has to make this UDF more robust! ;)
function SwapTag(strSource, strFind, strReplace) {
var retVal = strSource;
// make sure that the substring to find is not empty.
if (Len(Trim(strFind))) {
retVal = REFindNoCase(strSource,
"(|[[:space:]]+[^>]*>)", "\1#strReplace#\2",
"ALL");
}
return retVal;
}


James Ang
Senior Programmer
MedSeek, Inc.
[EMAIL PROTECTED]

-Original Message-
From: James Ang 
Sent: Monday, April 22, 2002 2:45 PM
To: CF-Talk
Subject: RE: REReplace and RegExp


Try this:

REReplaceNoCase(agents, "(|[[:space:]]+[^>]*>)",
"\1a\2", "ALL")

I have tested this code on CFAS 5 on WinXP.

James Ang
Senior Programmer
MedSeek, Inc.


-Original Message-
From: Troy Simpson [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 22, 2002 2:15 PM
To: CF-Talk
Subject: REReplace and RegExp


Dear CF-Talkers:

I have a string in the following format( I've added carriage returns for
readability):

Bruggen, Coosje van, b.1942' & 'Berger, Patrick, b.
1947'
>

I want to process the string to look like this (replace the AGENT tags
with ANCHOR tags):

Bruggen, Coosje van, b.1942' &
'Berger, Patrick, b. 1947'
>

I have somewhat accomplished this like so but still need some work and
have become a little lost.

REReplaceNoCase(
agent,

'(.*)?',
' \4 ',
"ALL")>

**Another problem is that the AGENT Attributes can be in any order which
really throughs wrench into things.

Anyone have any advise on how to approach this?
I would really appreciated it.

Thanks,
Troy


--
Troy Simpson
Applications Analyst/Programmer - MCSE, OCP-DBA
North Carolina State University Libraries
Campus Box 7111 | Raleigh | North Carolina
ph.919.515.3855 | fax.919.513.3330
[EMAIL PROTECTED]



__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
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



RE: REReplace and RegExp

2002-04-23 Thread Raymond Camden

Someone will have to submit it. Considering Rob and I are already
_swamped_ under the queue now, it would be better if someone were to
submit this. I just can't bring myself to make the queue bigger. I'll
let others do that. ;)

Just as an FYI - both Rob and I know the queue is getting a bit backed
up now. Rob is very busy, and I've been working on a little product you
may have heard of. (It's does dynamic web page crap. ;) Once things
settle down, the queue will get busted down. Plus, we have some
interesting things in work for the site as well as a new site.

===
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -Original Message-
> From: James Ang [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, April 22, 2002 6:11 PM
> To: CF-Talk
> Subject: RE: REReplace and RegExp
> 
> 
> Actually, this looks like a UDF candidate for cflib.org. Ray Camden?
> 
> I don't have time to format it nicely for cflib.org. Anyone wants to
> volunteer? :)
> 
> // Assuming that strFind and strReplace has no RegExp characters that
> need to be escaped
> // else, someone has to make this UDF more robust! ;)
> function SwapTag(strSource, strFind, strReplace) {
> var retVal = strSource;
> // make sure that the substring to find is not empty.
> if (Len(Trim(strFind))) {
> retVal = REFindNoCase(strSource,
> "(|[[:space:]]+[^>]*>)", 
> "\1#strReplace#\2",
> "ALL");
> }
> return retVal;
> }
> 
> 

__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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



RE: REReplace and RegExp

2002-04-23 Thread Troy Simpson

James,

Thanks for the response.  It has given me other ideas about how to approach
this.

It appears that the solution you provided only replaces that Tags, which is
part of the desired solution.  I also need to obtain the value of the
attributes and put then in differenct attributes for the  tag.  The real
kicker is that the attributes in the  tag can be in any order.  For
example:

>From this:
Oldenburg, Claes
Thure,b.1929
Bruggen, Coosje van,
b.1942

To this:
Oldenburg, Claes Thure, b.1929
Bruggen, Coosje van, b.1942

So far, I've come up with this, which is not complete:
  REReplaceNoCase(
agentList,

'(.[^<]*?)',
'\4',
"ALL")>

Background:
I am using ColdFusion 4.51 on a Windows2000/IIS5 server.  The  tags
come from an XML document that looks like this:



  60793
  Parc Andre-Citroen
  Paris: Parks and Gardens, 1615-1992
  lGxFR B343a A53ed05
  
Oldenburg, Claes Thure,
b.1929
Bruggen, Coosje van,
b.1942
Berger, Patrick, b.
1947
Viguier, Jean-Paul
Jodry,
Jean-Francois
Clement, Gilles
Provost, Alain
  



Thanks,
Troy

--
Troy Simpson
Applications Analyst/Programmer - MCSE, OCP DBA
North Carolina State University Libraries
Campus Box 7111 | Raleigh | North Carolina
ph.919.515.3855 | fax.919.513.3330
[EMAIL PROTECTED]

-Original Message-
From: James Ang [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 5:45 PM
To: CF-Talk
Subject: RE: REReplace and RegExp


Try this:

REReplaceNoCase(agents, "(|[[:space:]]+[^>]*>)",
"\1a\2", "ALL")

I have tested this code on CFAS 5 on WinXP.

James Ang
Senior Programmer
MedSeek, Inc.


-Original Message-
From: Troy Simpson [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 2:15 PM
To: CF-Talk
Subject: REReplace and RegExp


Dear CF-Talkers:

I have a string in the following format( I've added carriage returns for
readability):

Bruggen, Coosje van, b.1942' & 'Berger, Patrick, b.
1947'
>

I want to process the string to look like this (replace the AGENT tags
with ANCHOR tags):

Bruggen, Coosje van, b.1942' &
'Berger, Patrick, b. 1947'
>

I have somewhat accomplished this like so but still need some work and
have become a little lost.

REReplaceNoCase(
agent,

'(.*)?',
' \4 ',
"ALL")>

**Another problem is that the AGENT Attributes can be in any order which
really throughs wrench into things.

Anyone have any advise on how to approach this?
I would really appreciated it.

Thanks,
Troy


--
Troy Simpson
Applications Analyst/Programmer - MCSE, OCP-DBA
North Carolina State University Libraries
Campus Box 7111 | Raleigh | North Carolina
ph.919.515.3855 | fax.919.513.3330
[EMAIL PROTECTED]



__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
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



Re: REReplace and RegExp

2002-04-23 Thread James Ang

Troy,

What you need is a 2-part parser. There isn't an easy way unless you
decide to use MS XML Parser or the Apache.org Java parser to parse the
XML.

If you decided not to use the Apache or the MS XML parsers, here's how
your tag parser would do:

Step 1: Retrieve a start tag one at a time:
]*)>

Step 2: Retrieve the individual attributes of the tag retrieved in step
1

Step 3: Perform transformation of the attributes in step 2.

Step 4: Perform transformation of the tag in Step 1

Step 5: Place the transformed string back in to xml input stream OR
place the transformed stream into your output stream.

Step 6: If not end of file/stream, go to Step 1.

Attached is a sample code that might help. It is meant for CFAS 5. I
wrote it thinking that it would solve your problem until I re-read your
posting. :P The attached file should provide some insight, I hope. :)
For the code to work in CFAS 4.5.x, you will need to convert the UDF to
Custom Tags.

Good luck. :)

Back to *real* work. (This list is too much fun.)

James Ang
Senior Programmer
MedSeek, Inc.
[EMAIL PROTECTED]


- Original Message - 
From: "Troy Simpson" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, April 23, 2002 8:04 AM
Subject: RE: REReplace and RegExp


James,

Thanks for the response.  It has given me other ideas about how to
approach this.

It appears that the solution you provided only replaces that Tags, which
is part of the desired solution.  I also need to obtain the value of the
attributes and put then in differenct attributes for the  tag.  The
real kicker is that the attributes in the  tag can be in any
order.  For
example:

>From this:
Oldenburg, Claes
Thure,b.1929 Bruggen, Coosje van, b.1942

To this:
Oldenburg, Claes Thure, b.1929 Bruggen, Coosje van, b.1942

So far, I've come up with this, which is not complete:
  REReplaceNoCase(
agentList,

'(.[^<]*?)',
'\4',
"ALL")>

Background:
I am using ColdFusion 4.51 on a Windows2000/IIS5 server.  The 
tags come from an XML document that looks like this:



  60793
  Parc Andre-Citroen
  Paris: Parks and Gardens, 1615-1992
  lGxFR B343a A53ed05
  
Oldenburg, Claes Thure,
b.1929
Bruggen, Coosje van,
b.1942
Berger, Patrick, b.
1947
Viguier,
Jean-Paul
Jodry,
Jean-Francois
Clement,
Gilles
Provost, Alain
  



Thanks,
Troy

--
Troy Simpson
Applications Analyst/Programmer - MCSE, OCP DBA
North Carolina State University Libraries
Campus Box 7111 | Raleigh | North Carolina
ph.919.515.3855 | fax.919.513.3330
[EMAIL PROTECTED]

-Original Message-
From: James Ang [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 5:45 PM
To: CF-Talk
Subject: RE: REReplace and RegExp


Try this:

REReplaceNoCase(agents, "(|[[:space:]]+[^>]*>)",
"\1a\2", "ALL")

I have tested this code on CFAS 5 on WinXP.

James Ang
Senior Programmer
MedSeek, Inc.


-Original Message-
From: Troy Simpson [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 2:15 PM
To: CF-Talk
Subject: REReplace and RegExp


Dear CF-Talkers:

I have a string in the following format( I've added carriage returns for
readability):

Bruggen, Coosje van, b.1942' & 'Berger, Patrick, b.
1947'
>

I want to process the string to look like this (replace the AGENT tags
with ANCHOR tags):

Bruggen, Coosje van, b.1942' &
'Berger, Patrick, b. 1947'
>

I have somewhat accomplished this like so but still need some work and
have become a little lost.

REReplaceNoCase(
agent,

'(.*)?',
' \4 ',
"ALL")>

**Another problem is that the AGENT Attributes can be in any order which
really throughs wrench into things.

Anyone have any advise on how to approach this?
I would really appreciated it.

Thanks,
Troy


--
Troy Simpson
Applications Analyst/Programmer - MCSE, OCP-DBA
North Carolina State University Libraries
Campus Box 7111 | Raleigh | North Carolina
ph.919.515.3855 | fax.919.513.3330
[EMAIL PROTECTED]




__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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



RE: REReplace and RegExp

2002-04-23 Thread Troy Simpson

James,

Thanks again.  Great food for thought.

Is there a performance hit with either of the XML Parsers you suggested?
If so, what has been your experience?
Do these XML Parsers use something called "XPath" to get the data from the
XML Document?

Background:
I have created a pre-joined resultset of all the records() and
stored them in an Oracle9i Table (a.k.a Materialize View).  This basically
takes all the records and joins them together into a denormalized
spreadsheet to elliminate the expensive joins at runtime.  One of the
columns in my Table contains an XML Document compiled from all the tables
and columns  used for TEXT indexing and searching.

Like I said, the documents are stored in an Oracle9i database table column
as an XML document of type XMLType (clob or Character Large Object).  There
is some functionality in the database to parse the XML Document but as of
now, I do not know how elaborate or expansive these functions are.  Ideally,
I am trying to make the Oracle9i Database do the work for me before
returning the result set to the ColdFusion Application Server for
processing.  So far I've been able to get a list of  tags for all my
 in a .

I wonder if the XML functionality in the Oracle9i database exist and is as
good as that of the two parsers you suggested?

I also have the option to store the values in seperate columns.  The problem
I am running into is that mutliple  can exist for each 
and I only want one record in the table(a.k.a Materialized View) for each
.

XML Document
--


  60793
  Parc Andre-Citroen
  Paris: Parks and Gardens, 1615-1992
  lGxFR B343a A53ed05
  
Oldenburg, Claes Thure,
b.1929
Bruggen, Coosje van,
b.1942
Berger, Patrick, b.
1947
Viguier, Jean-Paul
Jodry,
Jean-Francois
Clement, Gilles
Provost, Alain
  

-
Thanks
Troy

--
Troy Simpson
Applications Analyst/Programmer - MCSE, OCP DBA
North Carolina State University Libraries
Campus Box 7111 | Raleigh | North Carolina
ph.919.515.3855 | fax.919.513.3330
[EMAIL PROTECTED]

-Original Message-
From: James Ang [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 1:14 PM
To: CF-Talk
Subject: Re: REReplace and RegExp


Troy,

What you need is a 2-part parser. There isn't an easy way unless you
decide to use MS XML Parser or the Apache.org Java parser to parse the
XML.

If you decided not to use the Apache or the MS XML parsers, here's how
your tag parser would do:

Step 1: Retrieve a start tag one at a time:
]*)>

Step 2: Retrieve the individual attributes of the tag retrieved in step
1

Step 3: Perform transformation of the attributes in step 2.

Step 4: Perform transformation of the tag in Step 1

Step 5: Place the transformed string back in to xml input stream OR
place the transformed stream into your output stream.

Step 6: If not end of file/stream, go to Step 1.

Attached is a sample code that might help. It is meant for CFAS 5. I
wrote it thinking that it would solve your problem until I re-read your
posting. :P The attached file should provide some insight, I hope. :)
For the code to work in CFAS 4.5.x, you will need to convert the UDF to
Custom Tags.

Good luck. :)

Back to *real* work. (This list is too much fun.)

James Ang
Senior Programmer
MedSeek, Inc.
[EMAIL PROTECTED]


- Original Message -
From: "Troy Simpson" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, April 23, 2002 8:04 AM
Subject: RE: REReplace and RegExp


James,

Thanks for the response.  It has given me other ideas about how to
approach this.

It appears that the solution you provided only replaces that Tags, which
is part of the desired solution.  I also need to obtain the value of the
attributes and put then in differenct attributes for the  tag.  The
real kicker is that the attributes in the  tag can be in any
order.  For
example:

>From this:
Oldenburg, Claes
Thure,b.1929 Bruggen, Coosje van, b.1942

To this:
Oldenburg, Claes Thure, b.1929 Bruggen, Coosje van, b.1942

So far, I've come up with this, which is not complete:
  REReplaceNoCase(
agentList,

'(.[^<]*?)',
'\4',
"ALL")>

Background:
I am using ColdFusion 4.51 on a Windows2000/IIS5 server.  The 
tags come from an XML document that looks like this:



  60793
  Parc Andre-Citroen
  Paris: Parks and Gardens, 1615-1992
  lGxFR B343a A53ed05
  
Oldenburg, Claes Thure,
b.1929
Bruggen, Coosje van,
b.1942
Berger, Patrick, b.
1947
Viguier,
Jean-Paul
Jodry,
Jean-Francois
Clement,
Gilles
Provost, Alain
  



Thanks,
Troy

--
Troy Simpson
Applications Analyst/Programmer - MCSE, OCP DBA
North Carolina State University Libraries
Campus Box 7111 | Raleigh | North Carolina
ph.919.515.3855 | fax.919.513.3330
[EMAIL PROTECTED]

-Original 

  1   2   >