title: What are colons for in a preg_match pattern?
body: <p>In the following PHP code (not mine):</p>
  
  <pre><code>$has_trailing_slash = preg_match(':/$:', $string);
  </code></pre>
  
  <p>what is the purpose of the colons?  If I remove them, then the preg_match call complains if there isn't a trailing slash in the string.  With the colons, preg_match doesn't complain if there isn't a trailing slash.  So apparently the colons are some kind of conditional or optional indicator, but is this documented anywhere?  I can't find one word of documentation about using colons this way with preg_match, or regex in general.</p>