这些是我不应该在我的地址中允许的字符串:
"PO BOX","P0 DRAWER","POSTOFFICE", " PO ", " BOX ",
"C/O","C.O."," ICO "," C/O "," C\0 ","C/0","P O BOX",
"P 0 BOX","P 0 B0X","P0 B0X","P0 BOX","P0BOX","P0B0X",
"POBX","P0BX","POBOX","P.0.","P.O","P O "," P 0 ",
"P.O.BOX","P.O.B","POB ","P0B","P 0 B","P O B",
" CARE ","IN CARE"," APO "," CPO "," UPO ", "GENDEL",
"GEN DEL", "GENDELIVERY","GEN DELIVERY","GENERALDEL",
"GENERAL DEL","GENERALDELIVERY","GENERAL DELIVERY"
我创建了正则表达式:此表达式仅验证 POBOx 部分 - 请更正以不允许在我的地址字段中使用上述所有字符串
"([\\w\\s*\\W]*((P(O|OST)?.?\\s*((O(FF(ICE)?)?)?.?\\s*(B(IN|OX|.?))|B(IN|OX))+))[\\w\\s*\\W]*)+
|([\\w\\s*\\W]* (IN \s*(CARE)?\\s*)|\s*[\\w\\s*\\W]*((.?(APO)?|.?(cPO)?|.?(uPO))?.?\s*) [\\w\\s*\\W]*|([\\w\\s*\\W]*(GEN(ERAL)?)?.?\s*(DEL(IVERY)?)?.?\s* [\\w\\s*\\W]*))";