address parsing and validation technique required for Australia zone with regex
<p>We need to implement the validation for the following field</p>

<p><strong>Street Address/ Business Address</strong></p>

<p>Conditions which needs to be taken care are as below</p>

<p>Post office box, private bag NOT acceptable as address. The address field should not start with the following:</p>

<p><strong>NOTE:</strong> <em><strong>^ = space</em></strong></p>

<pre><code>G^P^O    
GPO^    
G.P.O    
GPO.    
G.P.O. Box

P^O    
P.O    
PO^    
PO.    
P.O.    
P.O.B    
POBOX    
POST BOX    
POST OFFICE BOX    
P / O Box    
P/O Box    
P O Box    
P.O. Box

BOX^    
BOX.    
Private Bag^    
Private Bag.    
Locked Bag
</code></pre>

<p>This list needs to be configurable to allow for additional rules to be included at a later date. There is no need to validate for upper/lower case</p>

<p>Can you suggest me this kind of validation can be better implement using Javascript or Java?</p>

<ol>
<li><p>if I use Java, is it advisable to use Regex class</p></li>
<li><p>If Javascript, what should be my way </p></li>
</ol>

<p>Kindly share your sample code if you have any</p>

<p>I am checking if we use of Regex would be helpful in doing this?</p>

<p>ps:  Since this project cant use any google or yahoo api or any other paid APIs to parse the street address.</p>
