Regular expression pattern matching
<p>I am trying to create pattern for following string </p>

<ol>
<li><code>abc deff &lt;XYZ&gt;.xls</code></li>
<li><code>&lt;XYZ&gt; abc.xlsx</code></li>
<li><code>ABCD.csv</code></li>
</ol>

<p>by using below pattern </p>

<pre class="lang-html prettyprint-override"><code>(\\w*)(\\&lt;)(\\w*)(\\&gt;)(\\w*)(\\.)(\\w*)
</code></pre>



<p>but it is not working for me</p>

<p>expected output </p>

<pre class="lang-html prettyprint-override"><code>1. abc deff &lt;XYZ&gt;.xls
   g1 = abc deff 
   g2 = XYZ
   g3 = xls

2. &lt;XYZ&gt; abc.xlxs
   g1 = "" 
   g2 = XYZ
   g3 = xlxs

3. ABCD.csv
   g1 = ABCD 
   g2 = ""
   g3 = csv
</code></pre>



<p>Thanks in advance for help</p>