Um.  This showed up after some responses, but I never saw an answer, so here
goes...

testnum = rereplace(testnum, "^332([0-9]*)", "\1");

This assumes that testnum is an int to begin with, so you should probably
test for that first.

If you have any questions about why this works or whatnot, or need something
more complicated or in-depth, why don't we slide over to
http://www.houseoffusion.com/cf_lists/index.cfm?method=threads&forumid=21
for all your CF RegEx needs!


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

: -----Original Message-----
: From: Michael T. Tangorre [mailto:[EMAIL PROTECTED]
: Sent: Monday, June 16, 2003 1:44 PM
: To: CF-Talk
: Subject: regex help
:
:
: I am trying to determine if an integer begins with 332.
:
: The number varies in length from 4 to 9 digits in length. If 332
: begins the number I would like to return the number minus the 332.
:
: I am still trying to learn regex so an explanation with any ideas
: would be very helpful. Here is what I am starting with:
:
: <cfset testNum = 3325665 />
: <cfset testNum = REreplace(in1,"^.(332).$","\1") />
:
: Thanks,
:
: MT
:
:
: 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

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

Reply via email to