fork(2) download
  1. import re
  2.  
  3. pattern = re.compile(r'\baaa_')
  4. my_list = [['aaa_house', 'aaa_car', 'aaa_table'], ['aaa_love', 'aaa_hate', 'aaa_life']]
  5. print([[pattern.sub('', i) for i in y] for y in my_list])
  6.  
  7.  
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
[['house', 'car', 'table'], ['love', 'hate', 'life']]