import re
p = re .compile ( r'^(.*?)(\b \d +\b )(.+?)\b (ste|st|ave|blvd)\b \s *(.*)$' )
p2 = re .compile ( r'^(.*?)(\b \d +\b )(.+)\b (ste|st|ave|blvd)\b \s *(.*)$' )
s = "the fashion potential hq 116 w 23rd st ste 5 5th floor new york ny 10011"
m = p.search ( s)
if m:
n = p2.search ( s)
if n:
print ( [ m.groups ( ) , n.groups ( ) ] )
aW1wb3J0IHJlCnAgPSByZS5jb21waWxlKHInXiguKj8pKFxiXGQrXGIpKC4rPylcYihzdGV8c3R8YXZlfGJsdmQpXGJccyooLiopJCcpCnAyID0gcmUuY29tcGlsZShyJ14oLio/KShcYlxkK1xiKSguKylcYihzdGV8c3R8YXZlfGJsdmQpXGJccyooLiopJCcpCnMgPSAidGhlIGZhc2hpb24gcG90ZW50aWFsIGhxIDExNiB3IDIzcmQgc3Qgc3RlIDUgNXRoIGZsb29yIG5ldyB5b3JrIG55IDEwMDExIgptID0gcC5zZWFyY2gocykKaWYgbToKCW4gPSBwMi5zZWFyY2gocykKCWlmIG46CgkJcHJpbnQoW20uZ3JvdXBzKCksIG4uZ3JvdXBzKCldKQ==
stdout
[('the fashion potential hq ', '116', ' w 23rd ', 'st', 'ste 5 5th floor new york ny 10011'), ('the fashion potential hq ', '116', ' w 23rd st ', 'ste', '5 5th floor new york ny 10011')]