Regular expression to match all commas outside double and single quotes
<p>I am trying to match commas outside double quotes(") using the following Regular expression</p>

<pre><code>,(?=(?:[^"]*"[^"]*")*[^"]*$)
</code></pre>

<p>for commas outside single quotes(') </p>

<pre><code>,(?=(?:[^']*'[^']*')*[^']*$)
</code></pre>

<p>My aim is to ignore commas either inside double quotes or inside single quote using single regular expression.</p>

<p>e.g. </p>

<p>"mahe,ndra"<strong>,</strong> "Gulla" <strong>,</strong> 40 <strong>,</strong> 'te,st'<strong>,</strong> 23</p>

<p>Could you please let me know, How can I handle this.</p>

<p>I will be grateful for your help</p>

<p>Mahendra</p>