title: RegEx: Remove numbers at the end of string and text after a specific string
body: <p>I need to remove some parts of a file:</p>
  
  <p>The content can look like this:</p>
  
  <pre><code>Lorem ipsum 12, 14
  Lorem 29
  34
  Lorem s. anything
  </code></pre>
  
  <p>This should become this one: </p>
  
  <pre><code>Lorem ipsum
  Lorem
  Lorem
  </code></pre>
  
  <p>1) All numbers should be removed (there can be multiple numbers separeted with a comma). If there is nothing else then the number, the line should be removed</p>
  
  <p>2) If there is "s.", everything after this point in this line should be removed.</p>
  
  <p>This is my attempt:</p>
  
  <pre><code>$myfile = fopen("file.txt", "r") or die("Unable to open file!");
  while(!feof($myfile)) {
      // remove some parts and output 
      $newString = preg_replace("/\d+$/","",fgets($myfile));
      echo newString . "&lt;br&gt;";
  }
  fclose($myfile);
  </code></pre>