title: Regular expression for checking
body: <p>I am facing a problem with regular expression in Python.
  The problem is that "Have to check a list and have to find out space containing strings."
  The code is:</p>
  
  <pre><code>def testFunction(self, func): 
          a = re.findall(r'\w+[\ ]*\(.*?\)', func)
          j = len(a)
          print j
          if j&lt;=1:
              return True
  
          else:
             s = re.findall(r"function *()", func) # cheking 
              t = len(s) # calculating the lenth
              if t&lt;=0:
                  return True
              else:
                  return False
  </code></pre>
  
  <p>It returns all time true whether there is a gap or nor.
  Example:it detects both "test()" &amp; "test ()"
  With in a word i am searching for a regular expression it will search for the gap inside a string.It will detect only "test ()" not "test()"
  I tried with <strong>regex = r'\w+[\ ]<em>(.</em>?)' 
                regex = r'^\s*'</strong>
  but unfortunately does not work.
  The work can be done by a regular expression that will differ between test(arg1) &amp; 
  test (arg1).
  Thanks.</p>