title: Extract substring based on position of character in string
body: <p>My dataframe looks like this -</p>
  
  <pre><code>df = data.frame(Entity=c('MM &gt; OSS &gt; EUROPE_lv3 &gt; FRANCElv4 &gt; FRANCElv5 &gt; FRANCElv6 &gt; FR_07_FRANCE &gt; FR_08_FRANCE &gt; FR_09_S50 &gt; FR_10_DVPOL12 &gt; FR_11_DRYPBA &gt; FR_12_RYPOP9000 &gt; FR_13_SX362707 &gt; SO362707',
                           'MM &gt; OSS &gt; AMERICA_lv3 &gt; AMERICA_11lv4 &gt; AMERICA_11lv5 &gt; INC_11 &gt; INCEDUSCHOOLFACIL_11 &gt; INCEDUC &gt; 30-00002 &gt; 40-00056 &gt; 50-00556 &gt; 60-59003 &gt; 27747001lv13 &gt; 27747003lv14',
                           'MM &gt; OSS &gt; AMERICA_lv3 &gt; AMERICA_11lv4 &gt; AMERICA_11lv5 &gt; INC_11 &gt; INCEDUSCHOOLFACIL_11 &gt; INCEDUC &gt; 30-00002 &gt; 40-00056 &gt; 50-00061 &gt; 60-23617 &gt; 76929001lv13 &gt; 76929017lv14',
                           'MM &gt; OSS &gt; EUROPE_lv3 &gt; UKIRELAND_13lv4 &gt; UKIRELAND_13lv5 &gt; UKIRELAND_13lv6 &gt; UKIE160000 &gt; UKIE160000_lv8 &gt; UKIE160000_lv9 &gt; UKIE262000 &gt; UKIE362004 &gt; UKIE462006 &gt; UKIE562072 &gt; GB344496',
                           'MM &gt; OSS &gt; AMERICA_lv3 &gt; AMERICA_11lv4 &gt; AMERICA_11lv5 &gt; INC_11 &gt; INCEDUSCHOOLFACIL_11 &gt; INCEDUC &gt; 30-00002 &gt; 40-00056 &gt; 50-00065 &gt; 60-22505 &gt; 94276001lv13 &gt; 94276002lv14'))
  </code></pre>
  
  <p>My Objective is -</p>
  
  <ol>
  <li>To extract everything after the <strong>last</strong> instance of &lt;. And store this in a separate column.  </li>
  <li>To extract everything <strong>between</strong> the <strong>second</strong> and <strong>third</strong> instance of &lt; . And store this in a separate column.</li>
  </ol>
  
  <p>My Attempt</p>
  
  <p>To extract everthing after the <strong>last</strong> instance of &lt;, I tried this -</p>
  
  <pre><code>sub("^.+&lt; ", "", df$Entity)
  </code></pre>
  
  <p>However it does not work as expected.</p>
  
  <p>Any help on tackling points 1) &amp; 2) would be appreciated.</p>