title: how to give priority for a regex pattern over another
body: <p>I am using regular expressions to extract university names. Mainly two patterns are observed.</p>
  
  <ol>
  <li>"some name" university --> ex: Anna University </li>
  <li>university of "something" --> ex: University of Exeter</li>
  </ol>
  
  <p>For this, I have written two patterns as,</p>
  
  <pre><code>regex = re.compile('|'.join([r'[Uu]niversity of (\w+){1,3}',r'(?:\S+\s){1,3}\S*[uU]niversity']))
  </code></pre>
  
  <p>But in few cases I am not getting proper expected answer.
  For example,</p>
  
  <pre><code>sentence  = "Biology Department University of Vienna"
  </code></pre>
  
  <p>For this sentence, applying above regular expression, I am getting</p>
  
  <pre><code>"Biology Department University"
  </code></pre>
  
  <p>which is wrong. I feel, since both patterns will be matched, the second pattern is getting matched and phrase is extracted.</p>
  
  <p>I need to give priority for first pattern, so that "university of something" will be extracted in similar scenario.</p>
  
  <p>can anybody help</p>