2017-11-22 5 views

答えて

0

この

import re 
s="sting, to test! splitting. on del!ms" 
print re.split("[!.,]",s) 
を試してみてください
0

あなたは正規表現を使用することができます。

import re 

s = 'abd cde def,hij! klm' 
matches = re.findall('[^,. ]*[,. ]+', s) 

for match in matches: 
    print(match) 
関連する問題