fork download
  1. import re
  2. text = '''
  3. (A) Match these:
  4. *** star* st**r
  5.  
  6. (B) Not these:
  7. 800*m *4,500
  8.  
  9. (C) And not these:
  10. 800**m **4,000
  11. '''
  12. print(re.findall(r'(?<!\S)(?!\*+\d)[a-zA-Z]*\*[a-zA-Z*]*', text))
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
['***', 'star*', 'st**r']