fork(1) download
  1. import re
  2. text = "Some word happy(+) feet"
  3. word = "happy(+) feet"
  4. word = map(re.escape, word)
  5. print r'%s' % '\s*'.join(word)
  6. pattern = re.compile(r'%s' % '\s*'.join(word), re.IGNORECASE)
  7. print len(pattern.findall(text))
Success #stdin #stdout 0.01s 7692KB
stdin
Standard input is empty
stdout
h\s*a\s*p\s*p\s*y\s*\(\s*\+\s*\)\s*\ \s*f\s*e\s*e\s*t
1