fork download
  1. import re
  2.  
  3. def processArray(array):
  4. newArray = []
  5. for l in array:
  6. m = re.findall(r"\[(.*?)]", " ".join(l))
  7. for n in m:
  8. k = re.findall(r'[A-Za-z0-9+-]+', n)
  9. if k:
  10. newArray.extend(k)
  11. return newArray
  12.  
  13. print(processArray([['Preconditions [+Here]\n'], ['Preconditions [+Is', '+The]\n'], ['Preconditions [-Example]\n']]))
Success #stdin #stdout 0.02s 9516KB
stdin
Standard input is empty
stdout
['+Here', '+Is', '+The', '-Example']