title: Is there a PHP function that can escape regex patterns before they are applied?
body: <p>Is there a PHP function that can escape regex patterns before they are applied?</p>
  
  <p>I am looking for something along the lines of the C# <a href="https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.escape.aspx" rel="noreferrer"><code>Regex.Escape()</code></a> function.</p>