Can't you just use left and right?

Like:

<cfset FORM.ccnumber = trim(FORM.ccnumber)>

<cfset leftnumbers = left(FORM.ccnumber, len(FORM.ccnumber) - 4)>
<cfset rightnumbers = right(FORM.ccnumber, 4)>

______________________
steve oliver
atnet solutions, inc.
http://www.atnetsolutions.com


-----Original Message-----
From: Jeff Fongemie [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 13, 2002 5:14 PM
To: CF-Talk
Subject: Split up a credit card number? Need regex handout!


Hello everyone,

  I need to take a given form field (numbers) and break it into 2
  parts. Then insert one part, and cfmail the other.   The number can
  be different lengths.

  For example: 3939 4444 4444 2222 may get passed by a form field.

  I need to insert the 3939 4444 4444 to a DB, and cfmail the 2222.

  I must admit that I'm stuck on this one, I can't even get a good
  working start. I can take the number and replace the first 4
  digits with nothing, which will give me the second half.

  But then how to get the first 4 digits?

  Am I going about this the wrong way? Is there a better approach?



  


Best regards,
 Jeff Fongemie                          mailto:[EMAIL PROTECTED]


_____________________________________________________
Composed on Wednesday, February 13, 2002, at 4:58:30 PM

______________________________________________________________________
Dedicated Windows 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=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to