RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Ultimate PO BOX finder
Expression
[p|P][\s]*[o|O][\s]*[b|B][\s]*[o|O][\s]*[x|X][\s]*[a-zA-Z0-9]*|\b[P|p]+(OST|ost|o|O)?\.?\s*[O|o|0]+(ffice|FFICE)?\.?\s*[B|b][O|o|0]?[X|x]+\.?\s+[#]?(\d+)*(\D+)*\b
Description
Modified version- to capture the PO BOX based on user input on the website - It will not include any Rural Route or any University Box
Matches
PO Box N,P O Box125,HC73 P.O. Box 217,P.O Box 0129,pobox123, P O Box124
Non-Matches
777 Post Oak Blvd,PSC 477 Box 396,RR 1 Box 1020
Author Rating: The rating for this expression. Senjaya Harianto
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: This just doesn't work. at all.
Name: RC
Date: 5/22/2014 12:46:52 PM
Comment:
It might work on the test bench, but when put into an actual MVC website it matches *any* string, not just the constituent parts of "Post Office Box" in all its many abbreviations. Post Office Box can't be Regexed witout some look-ahead/look-behind logic.


Title: This just doesn't work. at all.
Name: RC
Date: 5/22/2014 12:46:46 PM
Comment:
It might work on the test bench, but when put into an actual MVC website it matches *any* string, not just the constituent parts of "Post Office Box" in all its many abbreviations. Post Office Box can't be Regexed witout some look-ahead/look-behind logic.


Title: This just doesn't work. at all.
Name: RC
Date: 5/22/2014 12:46:42 PM
Comment:
It might work on the test bench, but when put into an actual MVC website it matches *any* string, not just the constituent parts of "Post Office Box" in all its many abbreviations. Post Office Box can't be Regexed witout some look-ahead/look-behind logic.


Title: This just doesn't work. at all.
Name: RC
Date: 5/22/2014 12:46:34 PM
Comment:
It might work on the test bench, but when put into an actual MVC website it matches *any* string, not just the constituent parts of "Post Office Box" in all its many abbreviations. Post Office Box can't be Regexed witout some look-ahead/look-behind logic.


Title: This just doesn't work. at all.
Name: RC
Date: 5/22/2014 12:46:30 PM
Comment:
It might work on the test bench, but when put into an actual MVC website it matches *any* string, not just the constituent parts of "Post Office Box" in all its many abbreviations. Post Office Box can't be Regexed witout some look-ahead/look-behind logic.


Title: This just doesn't work. at all.
Name: RC
Date: 5/22/2014 12:46:27 PM
Comment:
It might work on the test bench, but when put into an actual MVC website it matches *any* string, not just the constituent parts of "Post Office Box" in all its many abbreviations. Post Office Box can't be Regexed witout some look-ahead/look-behind logic.


Title: This just doesn't work. at all.
Name: RC
Date: 5/22/2014 12:46:14 PM
Comment:
It might work on the test bench, but when put into an actual MVC website it matches *any* string, not just the constituent parts of "Post Office Box" in all its many abbreviations. Post Office Box can't be Regexed witout some look-ahead/look-behind logic.


Title: There is mistake in this regexp
Name: Marcin Lewandowski
Date: 1/20/2012 4:45:01 AM
Comment:
This regexp doesn't accept: P.O.B. 123 In second section we have: \b[P|p]+(OST|ost|o|O)?\.?\s*[O|o|0]+(ffice|FFICE)?\.?\s*[B|b][O|o|0]?[X|x]+\.?\s+[#]?(\d+)*(\D+)*\b [B|b][O|o|0]?[X|x]+ so B or b, then optionally o and at least one X. I think that regexp should be: [p|P][\\s]*[o|O][\\s]*[b|B][\\s]*[o|O][\\s]*[x|X][\\s]*[a-zA-Z0-9]*|\\b[P|p]+(OST|ost|o|O)?\\.?\\s*[O|o|0]+(ffice|FFICE)?\\.?\\s*[B|b][O|o|0]?[X|x]?\\.?\\s+[#]?(\\d+)*(\\D+)*\\b (just replace [X|x]+ with [X|x]? )


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials