title: How to match entire words dynamically using Regex in Python
body: <p>Using Regex, I want to match a sequence of words entirely in Python.
  Statically it is possible, but I am unaware about the dynamic way of matching.</p>
  
  <p>Static method</p>
  
  <pre><code>import re
  print(re.search(r'\bsmaller than or equal\b', 'When the loan amount is smaller than or equal to 50000'))
  </code></pre>
  
  <p>I am trying to do the same thing dynamically, by matching the entire sequence with a list.<br>
  Here is the code snippet below:</p>
  
  <pre><code>import re
  list_less_than_or_equal = ['less than or equal', 'lesser than or equal', 'lower than or equal', 'smaller than or equal','less than or equals', 'lesser than or equals', 'lower than or equals', 'smaller than or equals', 'less than equal', 'lesser than equal', 'higher than equal','less than equals', 'lesser than equals', 'higher than equals']
  
  for word in list_less_than_or_equal:
      print(re.search(r'\b'+word+'\b', 'When the loan amount is smaller than or equal to 50000'))
  </code></pre>
  
  <p>It prints <code>None</code> as the output.</p>
  
  <p><strong>How to match the entire sequence of words dynamically?</strong></p>