fork download
  1. import re
  2.  
  3. text = "be besides being bee be, be. before, Be Be. forbe be_ be3 be"
  4. be = re.findall('(\\bbe\\b)', text, re.IGNORECASE)
  5. print(len(be))
  6. print(be)
  7.  
Success #stdin #stdout 0.01s 28384KB
stdin
Standard input is empty
stdout
6
['be', 'be', 'be', 'Be', 'Be', 'be']