POBox地址捕获

时间:2011-10-27 20:30:40

标签: regex

/^\s*((p(ost)?.?\s*(o(ff(ice)?)?)?.?\s+(b(in|ox))?)|b(in|ox))/i

以上是捕获邮政信箱地址的最佳正则表达式吗?

使用上述内容,它在下面标记的内容上失败了:

P.O. Box 123
PO 123
Post Office Box 123
P.O 123
Box 123
#123       // This one
123        // This one
POB 123
P.O.B 123  // This one
P.O.B. 123 // This one
Post 123
Post Box 123

你还能想到什么?

1 个答案:

答案 0 :(得分:1)

RegexLib.com有一个非常好的list of a number of different expressions你可以使用。

相关问题