E:/McNair/Projects/PatentAddress/RxPostcode.sql
:'''4. State (U.S.)''
:: There are some patterns that can be used to extract city state information.
::*'(^|\s)CITY NAME[,] STATE POSTCODE'
::The state and post code are always together, separated by a space. So we can also extract state information with regular expression too '([,]|[. ])\s\w{2,}\s{0,}\w{0,}\s{1,}\d{5}[-]\d{4}'
::For example,
NEW YORK, NY 10013-2412 | NY
HOUSTON, TEXAS 77256-6571 | TEXAS
BROOKINGS, SOUTH DAKOTA 57006-0128 | SOUTH DAKOTA
::*'CITY NAME STATE(Abbreviation) POSTCODE'
'(^|\s)\w{2}\s{1}\d{5}[-]\d{4}'
:: For example:
MASSACHUSETTS 02780-7319
NEW YORK NY 10022-3201
WAUKEGAN IL 60085-2195
::*'STATENAME POSTCODE'
::* 'D.C.' - dots between state name.
'D.C.\s\d{5}-\d{4}'
::The extracted state records are stored in table ptoassigneend_missus_final.