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