title: Regex taking too long in python
body: <p>I have used regex101 to test my regex and it works fine.What i am trying to is to detect these patterns</p>
  
  <ol>
  <li>section 1.2 random 2</li>
  <li>1.2 random 2</li>
  <li>1.2. random 2</li>
  <li>random 2</li>
  <li>random 2.</li>
  </ol>
  
  <p>But its just random it shouldn't match if the string is like that</p>
  
  <ol>
  <li>random</li>
  </ol>
  
  <p>My regex is this.</p>
  
  <pre><code>  m = re.match(r"^(((section)\s*|(\d+\.)|\d+|(\d+\.\d+)|[a-zA-z\s]|[a-zA-z\.\s])+((\d+\.$)|\d+$|(\d+\.\d+$)))","random random random random random",flags = re.I)
  </code></pre>
  
  <p>If i give in a long string it gets stuck.Any ideas?</p>