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