I have to extract 3 things from a string, PO box, street address and everything else.
Here's how the string would look:
DUNHOUR AGENCY INC PO BOX 48 44 TANNER STREET HADDONFIELD NJ 08033 VERONA NJ 070440324
I have managed to extract PO and street address using the following regex but have been running in circles to get the remaining part of the string.
Here's what my regex is;
\b(PO BOX \d{2,5}|PO Box \d{2,5}|P.O. BOX \d{2,5}|P O BOX \d{2,5})?\s*(\d+\s[A-z]+\s[A-z]+)\s(\d+\s[A-z]+)?
How can I get everything else as last group match?
I should also be able to extract rest of the data if PO box information is missing that is
*BENNETTI-HOLMES INSURANCE 43 VOSHELL MILL ROAD DOVER DE 19904
I should get false for PO, get the street address and everything else in last group match.