title: Get multiple values in an xml file
body: <pre><code>        &lt;!-- someotherline --&gt;
  &lt;add name="core" connectionString="user id=value1;password=value2;Data Source=datasource1.comapany.com;Database=databasename_compny" /&gt;
  </code></pre>
  
  <p>I need to grab the values in userid , password, source, database. Not all lines are in the same format.My desired result would be (username=value1,password=value2, DataSource=datasource1.comapany.com,Database=databasename_compny)</p>
  
  <p>This regex seems little bit more complicated as it is more complicated. Please, explain your answer if possible. </p>
  
  <p>I realised its better to loop through each line. Code I wrote so far</p>
  
  <pre><code>while read p || [[ -n $p ]]; do
    #echo $p
    if [[ $p =~ .*connectionString.* ]]; then
      echo $p
    fi
  done &lt;a.config
  </code></pre>
  
  <p>Now inside the if I have to grab the values.</p>