title: RegEx - If Our Site URL Contains This, Then
body: <p>need some regex help for a regex newb.  </p>
  
  <p>If our URL contains </p>
  
  <pre><code>SearchBox. 
  </code></pre>
  
  <p>(SearchBox with the dot on the end)   or    </p>
  
  <pre><code>SearchBox-Empty
  </code></pre>
  
  <p>Then, we need to do something.  So example matching URLs would be:</p>
  
  <p><a href="http://www.thesite.com/SearchBox.html" rel="nofollow">http://www.thesite.com/SearchBox.html</a></p>
  
  <p>or <a href="http://www.thesite.com/SearchBox-Empty.html" rel="nofollow">http://www.thesite.com/SearchBox-Empty.html</a></p>
  
  <p>And a non-matching URL would be:</p>
  
  <p><a href="http://www.thesite.com/SearchBox-Function.html" rel="nofollow">http://www.thesite.com/SearchBox-Function.html</a></p>
  
  <p>So, I only want it to be matched when there is not a function being called.</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>if((preg_match("@SearchBox\.@",$_SERVER['REQUEST_URI']) || preg_match("@SearchBox\-Empty@",$_SERVER['REQUEST_URI'])) &amp;&amp; !empty($_REQUEST['ID']) &amp;&amp; is_numeric($_REQUEST['ID'])) {
  </code></pre>
  
  <p>Thanks for your help!</p>