title: Using regex in a string for strpos()
body: <p>I want to get the scripts to search the $open_email_msg which different e-mails will have different info but the same format as below. </p>
  
  <p>I haven't really used regex much, but what i want to do is whenever i have it to search the string it would search for "Title: [data for title]", "Categories: [data for categories]. I am asking because i don't think something like </p>
  
  <pre><code>strpos($open_email_msg, "Title: (*^)"); 
  </code></pre>
  
  <p>would even work.</p>
  
  <p>This is just a snippet of the whole code, the rest inserts the info into a MySQL table and then is posted to a News Article on the site.</p>
  
  <p>Can somebody help me find a solution to this please?</p>
  
  <p>Strict e-mail message format:</p>
  
  <blockquote>
    <blockquote>
      <p>News Update<br>
      Title: Article Title<br>
      Tags: tag1 tag2 <br>Categories: Article Category, 2nd Article Category <br>Snippet:
      Article snippet.<br>
      Message:  Article Message. Images. More text,
      more text. Lorem impsum dolor sit amet.</p>
    </blockquote>
  </blockquote>
  
  <pre><code>&lt;?php
      //These functions searches the open e-mail for the the prefix defining strings.
          //Need a function to search after the space after the strings because the subject, categories, snippet, tags and message are constant-changing.
      $subject = strpos($open_email_msg, "Title:");       //Searches the open e-mail for the string "Title" 
          $subject = str_replace("Title: ", "" ,$subject);
      $categories = strpos($open_email_msg, "Categories:");       //Searches the open e-mail for the string "Categories"
      $snippet = strpos($open_email_msg,"Snippet");           //Searches the open e-mail for the string "Snippet"
      $content = strpos($open_email_msg, "Message");  //Searches the open-email for the string "Message"
      $tags = str_replace(' ',',',$subject); //DDIE
      $uri =  str_replace(' ','-',$subject); //DDIE
      $when = strtotime("now");   //date article was posted
  ?&gt;
  </code></pre>