Just adding some more feedback...
You should be prepared to parse the address in order of POSSIBLE values.
Here is the possible breakdown
**
PreCoor Coor PostCoor StreetNumber Direction StreetName StreetSuffix
PostDirection UnitType UnitNumber
**
PreCoor, PostCoor, Direction and PostDirection are DIRECTIONS (N,S,E or W)
Strip address from any commas and periods first
You'll have to regexp or loop your way through the possible Unit names (Unit, #, APT etc...) and the possibility that the following Unit_Number can be numeric [0-9] or letter based [a-z] or a combination of both. They also can be a length of 1-5 char commonly.
You'll also nee to check for possible PO BOX in address. If that's found all else is doesn't matter.
Normally, City, State and Zip are provided in their own fields.
Example on spliting the UNIT
mySQL
REPLACE(REPLACE(REPLACE(ADDR,'.',''),'-',''),',','') REGEXP '( UNIT|
APT| #| SUITE| STE| LOT) ?([0-9]{1,5}$|[a-z]{1,4}$)';
php
preg_match('/( UNIT| APT| #| SUITE| STE| LOT)
?([a-z]{1,3}|[0-9]{1,3})/i', $input_line, $output_array);