How do I supply multiple conditions to str_extract in r?
<p>I have a dataframe as follows </p>

<pre><code>  1     Tertiary seen.
  2     No tertiary seen.
  3     No anything seen.
  4     Tertiary everywhere.
</code></pre>

<p>I want to add a column only when Tertiary is seen but not when the regex No.*\. is seen.</p>

<pre><code>  1     Tertiary seen.        Tertiary
  2     No tertiary seen.       NA
  3     No anything seen.       NA
  4     Tertiary everywhere.  Tertiary 
</code></pre>

<p>I know I can use <code>|</code> in str_extract but &amp; doesn't seem to be accepted as follows</p>

<pre><code>Mydata$newcol&lt;-str_extract(Mydata$Text,"[Tt]ertiary&amp;!No.*[Tt]ertiary\\.")
</code></pre>