I have a below string to compare in PHP.and i made one regular expression for match the string.But it only match exactly same string so can some one help to get me regular expression to match below conditional string.
I have used below expression.
[poBox]\s\d{3}
below is my conditional string to match
POBox 123, POBox 1234, P.O.Box 123, P.O.Box 1234, P O Box 123, P O Box 1234, P.O. Box 123, P.O. Box 1234
[poBox]
means any one character between p
, o
, B
or x
. And \\d{3}
will not match the full extent of 1234
.
P\.?\s?O\.?\s?Box\s\d+
regex101 .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.