title: Matching URL containing one word AND another word using Regex
body: <p>I am trying to write a regular expression to be used in a Google Analytics goal that will match URLs containing</p>
  
  <blockquote>
    <p>?package=whatever</p>
  </blockquote>
  
  <p>and also</p>
  
  <blockquote>
    <p>/success</p>
  </blockquote>
  
  <p>The user will first visit a page like</p>
  
  <blockquote>
    <p>www.website.com/become-client/<strong>?package=greatpackage</strong></p>
  </blockquote>
  
  <p>and if they purchase they will be lead to this page</p>
  
  <blockquote>
    <p>www.website.com/become-client/<strong>?package=greatpackage/success</strong></p>
  </blockquote>
  
  <p>So based on this I could use the following regex</p>
  
  <blockquote>
    <p>\?package\=greatpackage/success</p>
  </blockquote>
  
  <p>This should match the correct destination and I would be able to use this in the goal settings in Analytics to create a goal for purchases of the greatpackage package.</p>
  
  <p>But sometimes the website will use other parameters in addition to ?package. Like ?type, ?media and so on.</p>
  
  <blockquote>
    <p>?type=business</p>
  </blockquote>
  
  <p>Resulting in URLs like this</p>
  
  <blockquote>
    <p>www.website.com/become-client/?package=greatpackage?type=business</p>
  </blockquote>
  
  <p>and if they purchase they will be lead to this page</p>
  
  <blockquote>
    <p>www.website.com/become-client/?package=greatpackage?type=business/success</p>
  </blockquote>
  
  <p>Now the /success part is moved away from the ?package part. My questions is how do I write a regex that will still match this URL no matter what other parameters there may be in between the parts?</p>
  
  <p>---update----</p>
  
  <p>@jonarz proposed the following and it works like a charm.</p>
  
  <blockquote>
    <p>\?package\=greatpackage(.*?)/success</p>
  </blockquote>
  
  <p>But what if there are two products with nearly the same name. For example greatpackage and greatpackageULTRA. The code above will select both. If changing the product names is impossible, how can I then select only one of them?</p>