Given a string of file names like this: 'New Text Document (2).txt New Text Document (3).txt New Text Document (4).txt New Text Document.txt\n' I would like to create a list with the following elements: ['New Text Document (2).txt', 'New Text Document (3).txt', 'New Text Document (4).txt', 'New Text Document.txt'] It seems that using regexes are the answer. Any ideas?
答案 0 :(得分:1)
I think this is the expression you are looking for:
\ ?(.+?\.\w+)
Of course you need to use that in your language of choice to get the captured matches