title: Java Regular Expression first matching char
body: <pre><code>String text = "ref=\"ar\" alias=\"as sa\" value=\"asa\"";
  </code></pre>
  
  <p>Actually i want get the value of all the data between the  double quotes of ref and alias . Have framed the regular expression too. But the prob i am facing is for alias it is not matching the first double quotes but the last one. I want data only upto the first double quotes</p>
  
  <pre><code>String patternstr="(alias=\".*\")|(ref=\"[[\\w]]*\")";    
  String patternstr2Level="\".*\"";
  </code></pre>
  
  <p>In first matching the two parameter will be acquired and in the second matching data in quotes will be acquired</p>
  
  <p>Current Result:</p>
  
  <p>"ar"</p>
  
  <p>"as sa" value="asa"</p>
  
  <p>Required Result:</p>
  
  <p>"ar"</p>
  
  <p>"as sa"</p>