From 107d4d5f634b3791fc6cf0e67f96e3960c5a234e Mon Sep 17 00:00:00 2001
From: John Maddock
Now let's take that expression and place it in some C++ code to validate the format of a credit card number:
-bool validate_card_format(const std::string s) +bool validate_card_format(const std::string& s) { static const boost::regex e("(\\d{4}[- ]){3}\\d{4}"); return regex_match(s, e); @@ -178,3 +178,4 @@ std::string human_readable_card_number(const std::string s) or copy at http://www.boost.org/LICENSE_1_0.txt)