title: Can i remove random numbers and letters from a string. But keep only the important ones
body: <p>Okey so i know that i can remove letters and numbers from a string by using <strong>preg_replace</strong>. but here is what im trying to do. </p>
  
  <p>Im using a wordpress plugin called <strong>Engage forms</strong>, that stores submitted data in a mySQL database. </p>
  
  <p>The tricky part is that the data that's being submitted is not stored cleanly for some reason.
  (reason being that the devs that made the plugin with some purpurs for this and i cant figuer out how they print out without the unknown numbers and letters.) </p>
  
  <p><strong>Here is what i mean:</strong><br>
  I submit the data </p>
  
  <ul>
  <li>Firstname: Peter </li>
  <li>Lastname: Stormare</li>
  <li>Email: storm@ren.com</li>
  <li>Phone: 0736997385</li>
  </ul>
  
  <hr>
  
  <p>Here is how the data inside the mySQL database looks and how its being printed out on the webpage:</p>
  
  <h2> Very messy </h2>
  
  <p>a:4:{s:18:"firstname25601459863853";s:5:"Peter";s:23:"lastnamn77151459863853";s:8:"Stormare";s:19:"email58511459863853";s:13:"Storm@ren.com";s:21:"phone22101459863853";s:10:"0736997385";}</p>
  
  <hr>
  
  <h2> My attempt at cleaning up the data </h2> 
  
  <p>So ive tried using my little knowledge and take away as much as i can with: </p>
  
  <pre><code>$patterns = array();
          $patterns[0] = '/[{}]/';
          $patterns[1] = '/[a-x]:[0-9]/';
          $patterns[2] = '/[0-9]:/';
          $patterns[3] = '/[a-x]:/';
          $patterns[4] = '/[":"]/';
          $patterns[5] = '/;/';
          $patterns[6] = '/namn[1]/'; 
          $replacements = array();
          $replacements[2] = '';
          $replacements[1] = '';
          $replacements[0] = '';
          $replacements[3] = '';
          $replacements[4] = ' ';
          $replacements[10] = ''
  
              echo preg_replace($patterns, $replacements, $leadslist);
  </code></pre>
  
  <p>Which should output this now: </p>
  
  <p>firstname25601459863853 Peter lastname77151459863853 Stormare email58511459863853 Storm@ren.com phone22101459863853 0736997385</p>
  
  <hr>
  
  <h1> The Big Question </h1>
  
  <p>Is there anyway i can now target the random numbers that follow firstname and the rest, without deleting the phone numbers? (the example phone number is 0736997385.</p>
  
  <hr>
  
  <h1> Possible solution </h1>
  
  <p>The best solution atm was submitted by user: Pei-turn. </p>
  
  <p>He showed me how to remove any number bigger then 10 digits. Using this pattern in Preg_replace()</p>
  
  <pre><code>$patterns[3] = '/[0-9]{0,9}[0-9]{11,}/';
  </code></pre>
  
  <p>This works very well. Only thing im worried about is if some data might get removed due to weird future form submissions.  </p>