Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
誰かが正規表現で私を少し助けてくれますか? 私は現在これを持っています: re.split(" +", line.rstrip())、スペースで区切られています。
re.split(" +", line.rstrip())
句読点もカバーするようにこれを拡張するにはどうすればよいですか?
import re st='one two,three; four-five, six' print re.split(r'\s+|[,;.-]\s*', st) # ['one', 'two', 'three', 'four', 'five', 'six']