title: Regular expression Group matching returns wrong value
body: <pre><code>Regex=
   "^\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)(\\s+(\\S+(\\s+(\\S+))?))?(\\s+(\\S+))?\\s*";
  
  input= "    1  ABC    DEF  GHI   JKL   PQR   ";
  </code></pre>
  
  <p>In the above input text the regular expression matches, but there is case where JKL can be word with space like "JKL MNO" so regular expression i have approched like optional </p>
  
  <pre><code>(\\s+(\\S+))?
  </code></pre>
  
  <p>While getting the group i am getting wrong value i.e </p>
  
  <pre><code>G1: 1 G2: ABC G3: DEF G4: GHI **G6: JKL PQR** G8:PQR
  </code></pre>
  
  <p>G6 Should be only JKL or JKL MNO as a word when MNO present, can you please figure out what i am doing wrong.</p>