fork download
  1. import re;
  2. content = ["hostname(config)#aaa new-model", "#fdfsfd b", "kthik", "pooooo", "shh"]
  3. res = []
  4. for data in content:
  5. res.extend(re.findall(r'#(\w+)', data))
  6. print(res)
  7.  
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
['aaa', 'fdfsfd']