Simple regex question

2009-06-10 Thread Rick Mason

I'm in need of some regex help.  I am working with a cfinput and I need a
pattern for regex validation that does the following:

Field can be blank but if filled out has to be exactly 17 characters which
are a combination of letters and numbers (VIN number)

Know this is simple but Google seems to be failing me this morning.

Thanks,

Rick


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323342
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Simple regex question

2009-06-10 Thread Ben Nadel

Try this:

^$|^[\w]{17}$

-Ben

-- 
Ben Nadel
Adobe Community Expert
Adobe Certified Advanced ColdFusion Developer
Manager New York ColdFusion User Group
http://www.bennadel.com

Need ColdFusion Help?
http://www.bennadel.com/Ask-Ben


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323343
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Simple regex question

2009-06-10 Thread Andy Matthews

[ ]|[a-z0-9]{17}

Should do it...

That basically allows for a space, or for 17 alphanumeric characters. 

-Original Message-
From: Rick Mason [mailto:rhma...@gmail.com] 
Sent: Wednesday, June 10, 2009 9:50 AM
To: cf-talk
Subject: Simple regex question


I'm in need of some regex help.  I am working with a cfinput and I need a
pattern for regex validation that does the following:

Field can be blank but if filled out has to be exactly 17 characters which
are a combination of letters and numbers (VIN number)

Know this is simple but Google seems to be failing me this morning.

Thanks,

Rick




~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323344
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Simple regex question

2009-06-10 Thread Andy Matthews

Great minds Ben...great minds. 

-Original Message-
From: Ben Nadel [mailto:b...@bennadel.com] 
Sent: Wednesday, June 10, 2009 9:51 AM
To: cf-talk
Subject: Re: Simple regex question


Try this:

^$|^[\w]{17}$

-Ben

--
Ben Nadel
Adobe Community Expert
Adobe Certified Advanced ColdFusion Developer Manager New York ColdFusion
User Group http://www.bennadel.com

Need ColdFusion Help?
http://www.bennadel.com/Ask-Ben




~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323345
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Simple regex question

2009-06-10 Thread Ben Nadel

Ha ha, most agreed :)


-- 
Ben Nadel
Adobe Community Expert
Adobe Certified Advanced ColdFusion Developer
Manager New York ColdFusion User Group
http://www.bennadel.com

Need ColdFusion Help?
http://www.bennadel.com/Ask-Ben


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323346
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Simple regex question

2009-06-10 Thread Andy Matthews

Technically speaking, the regex that Ben or I posted isn't correct. You
can't just have 17 alnum characters as each character (or character pairs)
in a VIN has a specific slot. Plus, VINs don't have the letters I, O, or Q.

Here's an excellent forum post about the subject.

http://www.phpfreaks.com/forums/index.php?topic=217075.0

It all just depends on how accurate you need to be.


andy

-Original Message-
From: Andy Matthews [mailto:li...@commadelimited.com] 
Sent: Wednesday, June 10, 2009 9:52 AM
To: cf-talk
Subject: RE: Simple regex question


[ ]|[a-z0-9]{17}

Should do it...

That basically allows for a space, or for 17 alphanumeric characters. 

-Original Message-
From: Rick Mason [mailto:rhma...@gmail.com]
Sent: Wednesday, June 10, 2009 9:50 AM
To: cf-talk
Subject: Simple regex question


I'm in need of some regex help.  I am working with a cfinput and I need a
pattern for regex validation that does the following:

Field can be blank but if filled out has to be exactly 17 characters which
are a combination of letters and numbers (VIN number)

Know this is simple but Google seems to be failing me this morning.

Thanks,

Rick






~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323347
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Simple regex question

2009-06-10 Thread Ben Nadel

I have to plead ignorance on this one - I don't know what a VIN number is.

-- 
Ben Nadel
Adobe Community Expert
Adobe Certified Advanced ColdFusion Developer
Manager New York ColdFusion User Group
http://www.bennadel.com

Need ColdFusion Help?
http://www.bennadel.com/Ask-Ben


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323348
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Simple regex question

2009-06-10 Thread Rick Mason

Thanks you Andy and Ben for your quick response.  A VIN number is a vehicle
identification number which is on your car's registration as well as being
on the driver side dash.

Think of it as a unique serial number for your car with vehicle information
baked into the number.

Andy the only problem that I had with your regex is that it let me enter
more than 17 characters.  I quickly added a maxlength which corrected the
problem.

There's a ISVIN function on CFLib and I had originally proposed to my boss
that I rewrite it in javascript but he didn't want that level of
functionality.


Rick

On Wed, Jun 10, 2009 at 10:58 AM, Ben Nadel b...@bennadel.com wrote:


 I have to plead ignorance on this one - I don't know what a VIN number is.

 --
 Ben Nadel
 Adobe Community Expert
 Adobe Certified Advanced ColdFusion Developer
 Manager New York ColdFusion User Group
 http://www.bennadel.com

 Need ColdFusion Help?
 http://www.bennadel.com/Ask-Ben


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323351
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Simple regex question

2009-06-10 Thread Andy Matthews

Ben...

VIN numbers are unique identifiers for cars. Generally there's a small metal
plaque on the driver side part of the dashboard, tucked way back under the
windshield. It's a fascinating number, as each set of digits have very
specific meanings. You can almost everything about a vehicle from the VIN.


andy 

-Original Message-
From: Ben Nadel [mailto:b...@bennadel.com] 
Sent: Wednesday, June 10, 2009 9:59 AM
To: cf-talk
Subject: Re: Simple regex question


I have to plead ignorance on this one - I don't know what a VIN number is.

--
Ben Nadel
Adobe Community Expert
Adobe Certified Advanced ColdFusion Developer Manager New York ColdFusion
User Group http://www.bennadel.com

Need ColdFusion Help?
http://www.bennadel.com/Ask-Ben




~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323352
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Simple regex question

2009-06-10 Thread Dawson, Michael

Think of it as a unique serial number for your car with vehicle
information baked into the number.

Show me the CARFAX!

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323353
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Simple regex question

2009-06-10 Thread Adrian Lynch

There's a ISVIN function on CFLib and I had originally proposed to my boss
that I rewrite it in javascript but he didn't want that level of
functionality.

Just do it, don't ask the boss! :OD


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323355
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Simple regex question

2009-06-10 Thread Rick Mason

Andy,

I jumped the gun a little too quickly.  Neither yours nor Ben's works.  Your
code worked fine when I was just typing in numbers for a quick test.

Once I started testing with actual VIN numbers it failed.  It isn't counting
the letters in the total count.  So 12345678901234567 succeeds but
1M345678901234567 fails.

Any suggestions?


Rick

On Wed, Jun 10, 2009 at 10:52 AM, Andy Matthews li...@commadelimited.comwrote:


 [ ]|[a-z0-9]{17}

 Should do it...

 That basically allows for a space, or for 17 alphanumeric characters.

 -Original Message-
 From: Rick Mason [mailto:rhma...@gmail.com]
 Sent: Wednesday, June 10, 2009 9:50 AM
 To: cf-talk
 Subject: Simple regex question


 I'm in need of some regex help.  I am working with a cfinput and I need a
 pattern for regex validation that does the following:

 Field can be blank but if filled out has to be exactly 17 characters which
 are a combination of letters and numbers (VIN number)

 Know this is simple but Google seems to be failing me this morning.

 Thanks,

 Rick




 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323358
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Simple regex question

2009-06-10 Thread Azadi Saryev

change [a-z0-9] to [a-zA-Z0-9]

it only fails because Andy's regexp does not allow uppercase letters.


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/


On 10/06/2009 23:15, Rick Mason wrote:
 Andy,
 
 I jumped the gun a little too quickly.  Neither yours nor Ben's works.  Your
 code worked fine when I was just typing in numbers for a quick test.
 
 Once I started testing with actual VIN numbers it failed.  It isn't counting
 the letters in the total count.  So 12345678901234567 succeeds but
 1M345678901234567 fails.
 
 Any suggestions?
 
 
 Rick
 
 On Wed, Jun 10, 2009 at 10:52 AM, Andy Matthews 
 li...@commadelimited.comwrote:
 
 [ ]|[a-z0-9]{17}

 Should do it...

 That basically allows for a space, or for 17 alphanumeric characters.

 -Original Message-
 From: Rick Mason [mailto:rhma...@gmail.com]
 Sent: Wednesday, June 10, 2009 9:50 AM
 To: cf-talk
 Subject: Simple regex question


 I'm in need of some regex help.  I am working with a cfinput and I need a
 pattern for regex validation that does the following:

 Field can be blank but if filled out has to be exactly 17 characters which
 are a combination of letters and numbers (VIN number)

 Know this is simple but Google seems to be failing me this morning.

 Thanks,

 Rick





 
 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323361
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Simple regex question

2009-06-10 Thread Azadi Saryev

PS: and Ben's needs to be adjusted to allow numbers:
^$|^[\w\d]{17}$


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/


On 10/06/2009 23:15, Rick Mason wrote:
 Andy,
 
 I jumped the gun a little too quickly.  Neither yours nor Ben's works.  Your
 code worked fine when I was just typing in numbers for a quick test.
 
 Once I started testing with actual VIN numbers it failed.  It isn't counting
 the letters in the total count.  So 12345678901234567 succeeds but
 1M345678901234567 fails.
 
 Any suggestions?
 
 
 Rick
 
 On Wed, Jun 10, 2009 at 10:52 AM, Andy Matthews 
 li...@commadelimited.comwrote:
 
 [ ]|[a-z0-9]{17}

 Should do it...

 That basically allows for a space, or for 17 alphanumeric characters.

 -Original Message-
 From: Rick Mason [mailto:rhma...@gmail.com]
 Sent: Wednesday, June 10, 2009 9:50 AM
 To: cf-talk
 Subject: Simple regex question


 I'm in need of some regex help.  I am working with a cfinput and I need a
 pattern for regex validation that does the following:

 Field can be blank but if filled out has to be exactly 17 characters which
 are a combination of letters and numbers (VIN number)

 Know this is simple but Google seems to be failing me this morning.

 Thanks,

 Rick





 
 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323362
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Simple regex question

2009-06-10 Thread Ben Nadel

\w should handle both alpha and numeric data. I am not sure why mine was
failing.

-Ben

-- 
Ben Nadel
Adobe Community Expert
Adobe Certified Advanced ColdFusion Developer
Manager New York ColdFusion User Group
http://www.bennadel.com

Need ColdFusion Help?
http://www.bennadel.com/Ask-Ben


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323364
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Simple regex question

2009-06-10 Thread Rick Mason

Azadi,

Figured that out while awaiting for the answer.  Reached John and Tim Farrar
via IM who suggested testing with smaller case letters.  Once we confirmed
that worked they gave me the update.  I will do further testing but that
looks like it is a winner.

Thanks all,


Rick

On Wed, Jun 10, 2009 at 12:31 PM, Azadi Saryev az...@sabai-dee.com wrote:


 PS: and Ben's needs to be adjusted to allow numbers:
 ^$|^[\w\d]{17}$


 Azadi Saryev
 Sabai-dee.com
 http://www.sabai-dee.com/


 On 10/06/2009 23:15, Rick Mason wrote:
   Andy,
 
  I jumped the gun a little too quickly.  Neither yours nor Ben's works.
  Your
  code worked fine when I was just typing in numbers for a quick test.
 
  Once I started testing with actual VIN numbers it failed.  It isn't
 counting
  the letters in the total count.  So 12345678901234567 succeeds but
  1M345678901234567 fails.
 
  Any suggestions?
 
 
  Rick
 
  On Wed, Jun 10, 2009 at 10:52 AM, Andy Matthews 
 li...@commadelimited.comwrote:
 
  [ ]|[a-z0-9]{17}
 
  Should do it...
 
  That basically allows for a space, or for 17 alphanumeric characters.
 
  -Original Message-
  From: Rick Mason [mailto:rhma...@gmail.com]
  Sent: Wednesday, June 10, 2009 9:50 AM
  To: cf-talk
  Subject: Simple regex question
 
 
  I'm in need of some regex help.  I am working with a cfinput and I need
 a
  pattern for regex validation that does the following:
 
  Field can be blank but if filled out has to be exactly 17 characters
 which
  are a combination of letters and numbers (VIN number)
 
  Know this is simple but Google seems to be failing me this morning.
 
  Thanks,
 
  Rick
 
 
 
 
 
 
 

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323365
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Simple regex question

2009-06-10 Thread Peter Boughton

In CF regex, \w is same as [a-zA-Z0-9_]

Most other regex flavours are the same as this.

Some regex flavours also include accented characters (áéí...) in their \w 
matches.



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323370
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: simple RegEx?

2009-04-11 Thread Bobby Hartsfield

rereplace(myTextField, \(.*?\), li, all)

or 

rereplace(myTextField, \((i|ii|iii|iv|v)\), li, all)

.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com


-Original Message-
From: CF Developer [mailto:coldfus...@mindkeeper.net] 
Sent: Thursday, April 02, 2009 8:00 AM
To: cf-talk
Subject: simple RegEx?


This should be simple for all you RegEx Gurus.

I have a textarea field that may contain list numbers such as : (i)  (ii).
What I want to do is convert those to LI statements.

I know you have to escape the parathesis but it produces:  LIi)  and
LIii)

How can I change it just to an LI statement (regardless on the list number,
since it can be i, ii, iii, iv)

I tried:

rereplace(myTextField,'\(*\)','ALL')

TIA!





~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321523
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


simple RegEx?

2009-04-02 Thread CF Developer

This should be simple for all you RegEx Gurus.

I have a textarea field that may contain list numbers such as : (i)  (ii).
What I want to do is convert those to LI statements.

I know you have to escape the parathesis but it produces:  LIi)  and LIii)

How can I change it just to an LI statement (regardless on the list number, 
since it can be i, ii, iii, iv)

I tried:

rereplace(myTextField,'\(*\)','ALL')

TIA!



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321211
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: simple RegEx?

2009-04-02 Thread Adrian Lynch

Check the stackoverflow in this result:

http://www.google.co.uk/search?hl=enq=find+roman+numerals+regexbtnG=Search
meta=

Adrian

 -Original Message-
 From: CF Developer [mailto:coldfus...@mindkeeper.net]
 Sent: 02 April 2009 13:00
 To: cf-talk
 Subject: simple RegEx?
 
 
 This should be simple for all you RegEx Gurus.
 
 I have a textarea field that may contain list numbers such as : (i)
 (ii).
 What I want to do is convert those to LI statements.
 
 I know you have to escape the parathesis but it produces:  LIi)  and
 LIii)
 
 How can I change it just to an LI statement (regardless on the list
 number, since it can be i, ii, iii, iv)
 
 I tried:
 
 rereplace(myTextField,'\(*\)','ALL')
 
 TIA!


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321215
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Simple regex question...

2008-10-14 Thread Che Vilnonis
Morning all. I need a RegEx to strip all of the characters that appear after
the *last* dash in a string (the last dash needs to be stripped as well).
How would I do something like that? Sample data is below. Thanks!

2995,2818-5
33054--2
3320-4
7789-4(1)
3641-45-1

Che Vilnonis
Application Developer
Advertising Systems Incorporated
8470C Remington Avenue
Pennsauken, NJ 08110
p: 856.488.2211
f: 856.488.1990
www.asitv.com 




~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313851
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Simple regex question...

2008-10-14 Thread Adrian Lynch
ListLast(theString, -)

Adrian
Building a database of ColdFusion errors at http://cferror.org/

-Original Message-
From: Che Vilnonis [mailto:[EMAIL PROTECTED]
Sent: 14 October 2008 15:27
To: cf-talk
Subject: Simple regex question...


Morning all. I need a RegEx to strip all of the characters that appear after
the *last* dash in a string (the last dash needs to be stripped as well).
How would I do something like that? Sample data is below. Thanks!

2995,2818-5
33054--2
3320-4
7789-4(1)
3641-45-1

Che Vilnonis
Application Developer
Advertising Systems Incorporated
8470C Remington Avenue
Pennsauken, NJ 08110
p: 856.488.2211
f: 856.488.1990
www.asitv.com


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313852
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Simple regex question...

2008-10-14 Thread Che Vilnonis
Adrian, Azadi... Thanks, that worked.  

-Original Message-
From: Azadi Saryev [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 14, 2008 10:35 AM
To: cf-talk
Subject: Re: Simple regex question...

how about just
left(string, len(string)-len(listlast(string, -))-1) ?

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/



Che Vilnonis wrote:
 Morning all. I need a RegEx to strip all of the characters that appear 
 after the *last* dash in a string (the last dash needs to be stripped as
well).
 How would I do something like that? Sample data is below. Thanks!

 2995,2818-5
 33054--2
 3320-4
 7789-4(1)
 3641-45-1

 Che Vilnonis
 Application Developer
 Advertising Systems Incorporated
 8470C Remington Avenue
 Pennsauken, NJ 08110
 p: 856.488.2211
 f: 856.488.1990
 www.asitv.com

   



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313856
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Simple regex question...

2008-10-14 Thread Azadi Saryev
how about just
left(string, len(string)-len(listlast(string, -))-1) ?

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/



Che Vilnonis wrote:
 Morning all. I need a RegEx to strip all of the characters that appear after
 the *last* dash in a string (the last dash needs to be stripped as well).
 How would I do something like that? Sample data is below. Thanks!

 2995,2818-5
 33054--2
 3320-4
 7789-4(1)
 3641-45-1

 Che Vilnonis
 Application Developer
 Advertising Systems Incorporated
 8470C Remington Avenue
 Pennsauken, NJ 08110
 p: 856.488.2211
 f: 856.488.1990
 www.asitv.com 

   

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313853
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Simple regex question...

2008-10-14 Thread Peter Boughton
I need a RegEx to strip all of the characters that appear after
the *last* dash in a string (the last dash needs to be stripped as well).

To match the last dash and everything after it, you want:
-[^-]*$

So to use that to strip of that segment of the string, just do:
dashless = rereplace( dashed , '-[^-]*$' , '' ) 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313866
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Yet Another Simple Regex Q

2004-10-04 Thread Matt Robertson
I have this regex which works splendidly:

[EMAIL PROTECTED]

I want to make it so the string has no less than 6 and no more than 60
chars, but if I plug in {6,60} it seems to either error out or keep
the regex from working no matter where or how I place it.

What am I missing?Ben's regex book either doesn't talk about this or
I can't find the reference.

-- 
--Matt Robertson--
MSB Designs, Inc.
mysecretbase.com
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Yet Another Simple Regex Q

2004-10-04 Thread Ben Doom
[EMAIL PROTECTED],60}$

seemed to work for me in a quick test.What CF version, etc.?

--Ben

Matt Robertson wrote:
 I have this regex which works splendidly:
 
 [EMAIL PROTECTED]
 
 I want to make it so the string has no less than 6 and no more than 60
 chars, but if I plug in {6,60} it seems to either error out or keep
 the regex from working no matter where or how I place it.
 
 What am I missing?Ben's regex book either doesn't talk about this or
 I can't find the reference.

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Yet Another Simple Regex Q

2004-10-04 Thread Matt Robertson
ben Doom wrote:
[EMAIL PROTECTED],60}$

Argh.I kept the plus sign when I was trying this before:

[EMAIL PROTECTED],60}$

Works great now.Thanks!

--Matt Robertson--
MSB Designs, Inc.
mysecretbase.com
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Simple RegEx question

2003-09-05 Thread Mike Mertsock
Hi,

I'm using cffile to read a .txt file.
I need to Replace the Carriage Return Line feed with a '|' when the new line
begins with a '0' or a '1'
and a '*' when the new line begins with a ''.

I am just too unfamiliar with RegEx to do it.

Any Ideas?

David DiPietro
OSU College of Medicine

Given that your text file contents are in a variable called fileContent, you can use a 
pair of regexes to do it:

cfset fileContent = REReplace( fileContent, \n([01]), |\1, all ) /
cfset fileContent = REReplace( fileContent, \n(), *\1, all ) /

The first regex does the | characters. It searches for a line break (the \n) followed 
by either a 0 or 1. It replaces it with a pipe and whatever numeral was matched. The 
secpond regex uses the same technique to do the asterisks.

Not sure if those can be combined into a single regex.

Good luck!

Mike Mertsock
Alfred University Web Team
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


Simple RegEx question

2003-09-04 Thread David DiPietro
Hi,

I'm using cffile to read a .txt file.
I need to Replace the Carriage Return Line feed with a '|' when the new line
begins with a '0' or a '1'
and a '*' when the new line begins with a ''.

I am just too unfamiliar with RegEx to do it.

Any Ideas?

David DiPietro
OSU College of Medicine



~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

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


Re: Simple RegEx question - got it :)

2003-09-04 Thread David DiPietro
Got it thanks


- Original Message - 
From: David DiPietro [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 12:50 PM
Subject: Simple RegEx question


 Hi,

 I'm using cffile to read a .txt file.
 I need to Replace the Carriage Return Line feed with a '|' when the new
line
 begins with a '0' or a '1'
 and a '*' when the new line begins with a ''.

 I am just too unfamiliar with RegEx to do it.

 Any Ideas?

 David DiPietro
 OSU College of Medicine



 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com


Re: Simple RegEx question

2003-09-04 Thread info
mytextfile = rereplacenocase(mytextfile,[#chr(13)##chr(10)#]{1,2}([01]),|\1,ALL);
mytextfile = rereplacenocase(mytextfile,[#chr(13)##chr(10)#]{1,2}(),*\1,ALL);

hth 

ike

-- Original Message -- 
From: David DiPietro [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Sep 04, 2003 12:50 PM
Subject: Re: Simple RegEx question

Hi,

I'm using cffile to read a .txt file.
I need to Replace the Carriage Return Line feed with a '|' when the new line
begins with a '0' or a '1'
and a '*' when the new line begins with a ''.

I am just too unfamiliar with RegEx to do it.

Any Ideas?

David DiPietro
OSU College of Medicine




~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

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


RE: Simple RegEx question

2003-09-04 Thread Ben Doom
With three replaces similar to the following:

string = replace(string, #chr(10)##chr(13)#0, |0, all);

You can do it without regex.  Really, unless there's a need to do it with 2
lines instead of 3, regex is overkill.

--  Ben Doom
Programmer  General Lackey
Moonbow Software, Inc

: -Original Message-
: From: David DiPietro [mailto:[EMAIL PROTECTED]
: Sent: Thursday, September 04, 2003 12:50 PM
: To: CF-Talk
: Subject: Simple RegEx question
:
:
: Hi,
:
: I'm using cffile to read a .txt file.
: I need to Replace the Carriage Return Line feed with a '|' when
: the new line
: begins with a '0' or a '1'
: and a '*' when the new line begins with a ''.
:
: I am just too unfamiliar with RegEx to do it.
:
: Any Ideas?
:
: David DiPietro
: OSU College of Medicine
:
:
:
: 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


RE: calling ben doom or other 4 simple regex

2003-08-29 Thread Ben Doom
Sorry to take so long to get to something with my name on it, but I was out
of town yesterday.

If what you wanted was just the 27 this is probably the closest so far.

I personally would probably take a cue from Mr. Dinowitz and do something
like this:

num = rereplace(string, .*\$([1-9][0-9]*).*, \1);

That will strip any leading 0's off the price.


--  Ben Doom
Programmer  General Lackey
Moonbow Software, Inc

: -Original Message-
: From: Matthew Walker [mailto:[EMAIL PROTECTED]
: Sent: Thursday, August 28, 2003 5:32 PM
: To: CF-Talk
: Subject: RE: calling ben doom or other 4 simple regex
:
:
: How about Rereplace(mystring, [^$]*\$([[:digit:]]+)\..*, \1)
:
:  -Original Message-
:  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
:  Sent: Friday, 29 August 2003 9:11 a.m.
:  To: CF-Talk
:  Subject: calling ben doom or other 4 simple regex
: 
:  i have a form that the user can select from a menu
:  say they pick this one
: 
:  DVD : Shipping(europe) : insurance  total $27.00(us funds)
: 
:  i need to strip that down to be just the dollar amount in a whole # so
:  that # can be used on a paypal button.
:  in this case 27
: 
: 
: 
: 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com


calling ben doom or other 4 simple regex

2003-08-28 Thread cf
i have a form that the user can select from a menu
say they pick this one

DVD : Shipping(europe) : insurance  total $27.00(us funds)

i need to strip that down to be just the dollar amount in a whole # so
that # can be used on a paypal button.
in this case 27


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

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


AW: calling ben doom or other 4 simple regex

2003-08-28 Thread Ingo Mann
twsst


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

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


Re: calling ben doom or other 4 simple regex

2003-08-28 Thread Michael Dinowitz
\$([1-9][0-9]*\.[0-9]{2})
Starts with a dollar sign (escaped), has a number (non-zero), may be followed by
any other numbers, followed by a period (escaped) followed by 2 numbers.
Everything other than the dollar sign is in a sub expression so it can be
returned separately

REFind('\$([1-9][0-9]*\.[0-9]{2})', string, 1, 1)
Will return the sub expression.

Michael Dinowitz
Finding technical solutions to the problems you didn't know you had yet
- Original Message - 
From: [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, August 28, 2003 5:10 PM
Subject: calling ben doom or other 4 simple regex


 i have a form that the user can select from a menu
 say they pick this one

 DVD : Shipping(europe) : insurance  total $27.00(us funds)

 i need to strip that down to be just the dollar amount in a whole # so
 that # can be used on a paypal button.
 in this case 27


 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


RE: calling ben doom or other 4 simple regex

2003-08-28 Thread Barney Boisvert
myString = DVD : Shipping(europe) : insurance  total $27.00(us funds);
myCost = val(REreplace(myString, ^.*\$, , one));

that should work, as long as the '$' before the cost is the last dollar sign
in the string.

barneyb
---
Barney Boisvert, Senior Development Engineer
AudienceCentral
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax   : 360.647.5351

www.audiencecentral.com


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 28, 2003 2:11 PM
 To: CF-Talk
 Subject: calling ben doom or other 4 simple regex


 i have a form that the user can select from a menu
 say they pick this one

 DVD : Shipping(europe) : insurance  total $27.00(us funds)

 i need to strip that down to be just the dollar amount in a whole # so
 that # can be used on a paypal button.
 in this case 27


 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com


RE: calling ben doom or other 4 simple regex

2003-08-28 Thread Matthew Walker
How about Rereplace(mystring, [^$]*\$([[:digit:]]+)\..*, \1)

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Friday, 29 August 2003 9:11 a.m.
 To: CF-Talk
 Subject: calling ben doom or other 4 simple regex
 
 i have a form that the user can select from a menu
 say they pick this one
 
 DVD : Shipping(europe) : insurance  total $27.00(us funds)
 
 i need to strip that down to be just the dollar amount in a whole # so
 that # can be used on a paypal button.
 in this case 27
 
 
 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

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