title: Regex- To handle null (when no characters are present between expressions)
body: <p>I have a regex situation.</p>
  
  <p>My text looks like :</p>
  
  <pre><code>text='abcd&lt;a href="&gt;&lt;/a&gt;&lt;/div&gt;abcd&lt;i&gt;&lt;a href="&gt;World Bank&lt;/a&gt;'
  </code></pre>
  
  <p>I want to capture all the hyperlinks, The regex I have written is given below-</p>
  
  <pre><code>re.findall("&lt;a href=.+?&gt;(.+?)&lt;/a&gt;", text, re.DOTALL)
  </code></pre>
  
  <p>When I run this it given me an output:</p>
  
  <pre><code>['&lt;/a&gt;&lt;/div&gt;abcd&lt;i&gt;&lt;a href="&gt;World Bank']
  </code></pre>
  
  <p>The above output occurs because there is no character between </p>
  
  <pre><code>&lt;a href="&gt;&lt;/a&gt; 
  </code></pre>
  
  <p>When I insert any character between the above expressions, I get Correct output.</p>
  
  <p>From the above text I need an output that is</p>
  
  <pre><code>['World Bank']
  </code></pre>
  
  <p>How can I modify the regex to get the above output.</p>