title: java regular expression split pattern
body: <p>I want to split the following string:</p>
  
  <pre><code>String line ="DOB,1234567890,11,07/05/12,\"first,last\",100,\"is,a,good,boy\"";
  </code></pre>
  
  <p>into following tokens:</p>
  
  <pre><code>DOB
  1234567890
  11
  07/05/12
  first,last
  100
  is,a,good,boy
  </code></pre>
  
  <p>I tried using following regular expression:</p>
  
  <pre><code>import java.util.*;
  import java.lang.*;
  import java.util.regex.*;
  import org.apache.commons.lang.StringUtils;
  
  class SplitString{
  
      public static final String quotes = "\".[[((a-z)|(A-Z))]+( ((a-z)|(A-Z)).,)*.((a-z)|(A-Z))].\"" ;
      public static final String ISSUE_UPLOAD_FILE_PATTERN = "((a-z)|(A-Z))+ [(((a-z)|(A-Z)).,)* + ("+quotes+".,) ].((a-z)|(A-Z)) + ("+quotes+")";
  
      public static void main(String[] args){
  
          String line ="DOB,1234567890,11,07/05/12,\"first,last\",100,\"is,a,good,boy\"";
          String delimiter = ",";
  
      Pattern p = Pattern.compile(ISSUE_UPLOAD_FILE_PATTERN);
  
      Pattern pattern = Pattern.compile(ISSUE_UPLOAD_FILE_PATTERN);
      String[] output = pattern.split(line);
  
      System.out.println(" pattern: "+pattern);
  
      for(String a:output){
          System.out.println(" output: "+a);
      }
  
      }             
  }
  </code></pre>
  
  <p>Am I missing anything in the regular expression?</p>