0

Let's assume there's a text box somewhere on the page. Users can enter any number of any length, with spaces, hyphens, parentheses, etc. to define groupings. The system returns a list of what kinds of numbers that specific format could match. That is, an input of "111-11-1111" would return, among anything else applicable, "Social Security Number"; an input of "(111) 111-1111" would return "Canadian/American phone number"; an input of "1111 1111 1111 1111" would return "Credit card".

The implementation of this would be trivial, but is there a giant list out there of different number formats?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Nick Heer
  • 1,553
  • 1
  • 10
  • 7

1 Answers1

1

I think you need to write regular expressions for each type of number and if that regular expression matches than return the type name. You can find lots of regular expressions for SSN, phone number and credit card number on internet.

Check this thread for phone number regular expression. Phone Number Regular Expression

Community
  • 1
  • 1
Umair Saleem
  • 1,055
  • 5
  • 19
  • What I'm looking for is kind of a "master list" of common numerical formats and their corresponding regex. – Nick Heer Mar 27 '14 at 05:00
  • http://www.regxlib.com/ is giant website for regular expression. But you need to search for your related expression. Enjoy it. – Umair Saleem Mar 27 '14 at 05:04