title: Is there a MySQL equivalent of PHP's preg_replace?
body: <p>I have a to match a field in MySQL, for which I thought I could use a regular expression, but it appears that MySQL doesn't have the functionality I need to do the job.  Here's the scenario:</p>
  
  <p>I have a variable in PHP called $url.  Let's say this variable is set as the string "/article/my-article/page/2".  I also have a table of URLs in MySQL from which I would like to pull content.  The URLs stored in my table, however, include wildcards.</p>
  
  <p>Previously, I had this set up so that the value stored in the table looked like this: "/article/%/page/%".</p>
  
  <p>With that configuration, I could just run:</p>
  
  <pre><code>SELECT * FROM urls WHERE '$url' LIKE url
  </code></pre>
  
  <p>And this would match, which is the desired functionality.</p>
  
  <p>What I'd like to do now, is allow a more advanced wildcard, such that instead of "/article/%/page/%", my MySQL data could be "/article/{{slug}}/page/{{page_no}}".</p>
  
  <p>I want to create a SQL query that will match this data, using the same $url input. LIKE is no longer the correct comparison, since I'm not using the built-in "%" wildcard, but rather {{.*}}.  Any ideas how to accomplish this?</p>