On Sep 18, 6:56 am, Sidon <[EMAIL PROTECTED]> wrote:
> I solved this with regex:
>
> /(([0-9]{4}[-\s]{0,3}){3}(([0-9]{4}){1}))/
>
> Before save to Database, "Strip everything but numerics" :-)
>
> Check this regex here:
>
> ___http://cosmoverbal.net
>
Thanks for the link. What is wrong with just /[^0-9]/ we don't care if
the card number is formatted right, just that it is all numbers 0-9.
I'm not clear on regular expressions in ruby yet. Do you have a good
quick lesson on this syntax?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "ruby-on-rails-programming-with-passion" group.
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---