title: PHP regular expression
body: <p>I have a little problem with a reqular expression in my application. I have following code which works well for all patterns, that are not just '/':</p>
  
  <pre><code>if (preg_match("#". $pattern1 . "(/.*+)?#", $pattern2)) {
      $topActive = TRUE;
  }
  </code></pre>
  
  <p>When I have <code>$pattern1</code> with /line-up or /line-up/opening and <code>$pattern2</code> with /line-up/opening it works as expected. But it also matches when I have just '/' as <code>$pattern1</code>. what can I do to prevent matching against '/', but let it still match against the other mentioned patterns?</p>