title: how do I filter using dplyr for list of character strings ignoring numbers after a decimal place
body: <p>I have the following column in a data.frame called &quot;id&quot;:</p>
  <pre><code>   example_0test0|EMM3.71|NTERM| 
     example_0test1|_EMM92.2|CTERM| 
     example_0test2|_EMM92.2|NTERM| 
     example_0test0|EMM1|NTERM| 
     example_0test0|EMM100|NTERM| 
     example_0test0|EMM1.11|NTERM| 
     example_0test0|EMM1.123|NTERM| 
  </code></pre>
  <p>I would like to filter using dplyr filter function for a list of exact characters such as (keeping it simple): <code>EMM1</code> to give the following output:</p>
  <pre><code>&gt; test_df2
                                id col1 col2
  1     example_0test0|EMM1|NTERM| 10.4 exp4
  2  example_0test0|EMM1.11|NTERM| 10.3 exp6
  3 example_0test0|EMM1.123|NTERM| 10.3 exp7
  </code></pre>
  <p>I have a factor list of characters saved like this I would like to use as input for the filtering terms:</p>
  <pre><code>&quot;EMM1|EMM101|EMM103|EMM104|EMM108.1|EMM11|EMM113|EMM114|EMM116.1|EMM118|EMM12|EMM123|EMM19.4|EMM197|EMM2|&quot;
  </code></pre>
  <p>I have tried using a combination using &quot;filter&quot; and &quot;str_detect&quot; which kind of worked HOWEVER if my search list includes &quot;EMM1&quot; I would like to include things like &quot;EMM1.0&quot; or &quot;EMM1.1&quot;</p>
  <p>I suspect as each of my EMM terms in the column to filter by is encased in &quot;|&quot; like &quot;<code>text|EMM1.0|text</code>&quot; there might be a way to use this for the filtering?</p>
  <p>here is a mini example of the type of data.frame I am working with:</p>
  <pre><code>&gt; dput(test_df)
  structure(list(id = c(&quot;example_0test0|EMM3.71|NTERM|&quot;, &quot;example_0test1|_EMM92.2|CTERM|&quot;, 
  &quot;example_0test2|_EMM92.2|NTERM|&quot;, &quot;example_0test0|EMM1|NTERM|&quot;, 
  &quot;example_0test0|EMM100|NTERM|&quot;, &quot;example_0test0|EMM1.11|NTERM|&quot;, 
  &quot;example_0test0|EMM1.123|NTERM|&quot;), col1 = c(10.1, 10.2, 10.3, 
  10.4, 10.3, 10.3, 10.3), col2 = c(&quot;exp1&quot;, &quot;exp2&quot;, &quot;exp3&quot;, &quot;exp4&quot;, 
  &quot;exp5&quot;, &quot;exp6&quot;, &quot;exp7&quot;)), class = &quot;data.frame&quot;, row.names = c(NA, 
  -7L))
  </code></pre>