re in list of lists
问题 I have a list of lists (irregular lengths of sub-lists), on which I want to perform re operations but can't get it to work. I'm sure I'm missing something profane; could someone point out what I'm doing wrong? Consider the following code snippets: test_list = [ # sample list of lists in which I want to replace the "\n" ["test\n\n\n\n\n\n\n\n", "another test\n", "spam"], ["egg\n\n", "house"], ["\n\nabc", "def\n", "\n\n\nghi", "jklm\n\n", "nop(e)", "\nqrst\n"], ["uvw\n", "\n\nx", "yz\n\n"]] for