Hummm, well, I didn't have any luck finding how to determine what constitutes as an address examining the c++ code, but here's a PHP function that should work as expected:
function is_bitcoin_address($address) { return preg_match("/1[a-zA-Z0-9]{33}/", $address); }
if (is_bitcoin_address("17NdbrSGoUotzeGCcMMCqnFkEvLymoou9j")) echo "yes";
else echo "no";
?>
Bitcoin excludes a few normal characters for the sake of readability, and a Bitcoin address can be either 33 or 34 characters long. It's:
1[1-9A-HJ-NP-Za-km-z]{32,33}