【发布时间】:2021-01-20 06:37:12
【问题描述】:
我有一个地址列表已合并如下所示的邮政编码
65 Windermere Ave., Toronto, ON, M6S 3J4
15 Bruyeres Mews, Toronto, ON M5V 0G8, Canada
M6M1N7, Canada
437 revus Ave, L5G 1S2, Mississauga, ON
, ST. CATHARINES L2M 6Z2 ON
15 Viking Lane, Toronto M9B0A4 ON
我试过这个正则表达式来提取邮政编码,但没有输出
^.{3}(?:[\s]).{3}^$
更新
邮政编码示例:M6S 3J4,L5G 1S2,M9B0A4
【问题讨论】:
-
this 会有帮助吗?
标签: python-3.x regex