title: How to remove data after certain characters
body: <p>I need to know how to remove all characters from a value after the first D letter and 1st number or 2 second number. I am not sure how to start.</p>
  <p>I have a data frame and I have a column of type Character</p>
  <ul>
  <li>The column is called &quot; Eircode &quot;</li>
  </ul>
  <p>The postal codes go from D01 to D24 ( these are Dublin postal codes )</p>
  <p>The values are inputted like so
  <a href="https://i.stack.imgur.com/yHpE6.png" rel="nofollow noreferrer">What you see in red is what needs to be removed.</a></p>
  <p>I need to be able to remove the characters after the last digit.</p>
  <p>My dataframe is called &quot;MainSchools&quot;</p>
  <p><strong>So if the &quot; Eircode &quot; is <code>D03P820</code>, I need to have it as <code>D03</code> after my change.</strong></p>
  <p>I would preferably like to be able to do this with the <code>Tidyverse</code> package if possible.</p>