I need to validate a complete address using php and regex. This is what i have created so far.
<?php
$input = '15 Gordon St, 3121 Cremorne, Australia';
if (!preg_match('/^[^@]{1,63}@[^@]{1,255}$/', $input)) {
echo 'Not matched';
} else {
echo 'Matched';
}
sample Address.
15 Gordon St, 3121 Cremorne, Australia
This is returning false.
#, Street name, Zip Code, City, Country is the address format.