title: php regular expression parse data
body: <p>I have a field which contain 20 character (pad string with space character from right) like below:</p>
  <blockquote>
  <p>VINEYARD HAVEN MA<br />
  BOLIVAR TN<br />
  ,<br />
  BOLIVAR, TN<br />
  NORTH TONAWANDA, NY</p>
  </blockquote>
  <p>How can I use regular expression to parse and get data, the result I want will look like this:</p>
  <blockquote>
  <p>[1] VINEYARD HAVEN [2] MA</p>
  <p>[1] BOLIVAR [2] TN</p>
  <p>[1] , or empty [2] , or empty</p>
  <p>[1] BOLIVAR, or BOLIVAR [2] TN or ,TN</p>
  <p>[1] NORTH TONAWANDA, or NORTH TONAWANDA [2] NY or ,NY</p>
  </blockquote>
  <p>Currently I use this regex:</p>
  <pre><code>^(\D*)(?=[ ]\w{2}[ ]*)([ ]\w{2}[ ]*)
  </code></pre>
  <p>But it couldnot match the line:</p>
  <blockquote>
  <p>,</p>
  </blockquote>
  <p>Please help to adjust my regex so that I match all data above</p>