[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Regex Question



Hello,
I am working on creating a regex to match the various credit card numbering 
patterns. I am unsure of my syntax. I believe it to be correct, however in 
one regex syntax verification application I am using, I receive an error 
stating that there is an invalid use of a repeat. I tried to verify each 
card's regex, and received the same response. Here is the regex I am using 
for MasterCard patterns.

^5[1-5]\d{2}(?:(?:\s|\-)?\d{4}){3}$

It should match a pattern of
  xxxx-xxxx-xxxx-xxxx
  xxxx xxxx xxxx xxxx
  xxxxxxxxxxxxxxxx

The first digit will be a 5, the second will be from a range of 1-5.

Is my syntax incorrect or is my syntax verifier application?

Thanks!

_________________________________________________________________
Get ready for school! Find articles, homework help and more in the Back to 
School Guide! http://special.msn.com/network/04backtoschool.armx


-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.