title: TYPERROR: expected string or bytes-like object while using re.findall
body: <p>CODE:</p>
  <pre><code>def multi_re_find(patterns,phrase):
  
      for pat in patterns:
          print(&quot;Searching for pattern {}&quot;.format(pat))
          print(re.findall(pat,phrase))
          # print(pat.findall(phrase))
          print(&quot;\n&quot;)
  
  test_phrase1 = [&quot;This is a string! But it has punctuation. How can we remove it?&quot;]
  test_pattern1 = ['[^!.? ]+']
  
  multi_re_find(test_pattern1,test_phrase1)
  </code></pre>
  <p>ERROR:</p>
  <pre><code>Searching for pattern [^!.? ]+
  Traceback (most recent call last):
    File &quot;C:\Users\DELL\github\Python\Python_Level_Two\Regular_Expressions.py&quot;, line 67, in &lt;module&gt;
      multi_re_find(test_pattern1,test_phrase1)
    File &quot;C:\Users\DELL\github\Python\Python_Level_Two\Regular_Expressions.py&quot;, line 33, in multi_re_find
      print(re.findall(pat,phrase))
    File &quot;C:\Users\DELL\anaconda3\lib\re.py&quot;, line 223, in findall
      return _compile(pattern, flags).findall(string)
  TypeError: expected string or bytes-like object
  </code></pre>