title: How extract from a string after specific word
body: <p>I have this string :</p>
  
  <pre><code>string &lt;-"DIS_S_CD_EFS-NO_PCI-CD_ACT_CG-SOM_MT_ECT_CVE"
  </code></pre>
  
  <p>I need to extract only <code>SOM_MT_ECT_CVE</code> from it.</p>
  
  <p>So for me the key word is <code>SOM</code> (identify its position ). </p>
  
  <p>I tried using this :</p>
  
  <pre><code>d &lt;-substr(gregexpr(pattern ='SOM',"DIS_S_CD_EFS-NO_PCI-CD_ACT_CG-SOM_MT_ECT_CVE"),
             nchar("DIS_S_CD_EFS-NO_PCI-CD_ACT_CG-SOM_MT_ECT_CVE"),"DIS_S_CD_EFS-NO_PCI-CD_ACT_CG-SOM_MT_ECT_CVE")
  </code></pre>
  
  <p>But it return NA values.</p>