looking for a regular expression

¨ì©³¦b²Ö¤°»ò°Ú¡H shadowcaster.bbs at bbs.wretch.cc
Thu Aug 3 09:03:43 EDT 2006


※ 引述《__peter__ at web.de (Peter Otten)》之銘言:
> 到底在累什麼啊? wrote:
> > Thanks a lot! I have never thought of that.
> > But what if there's not only commas, but also periods and semicolons? I
> > want to find words between 2 near by punctuations. I think it would make
> > it difficult to use split instead of regular expression.
> Reenter re. Use
> re.split(r"[.;\-,]", my_string)
> instead of my_string.split(",").
> Peter

Thank you for your help.
--
夫兵者不祥之器物或惡之故有道者不處君子居則貴左用兵則貴右兵者不祥之器非君子
之器不得已而用之恬淡為上勝而不美而美之者是樂殺人夫樂殺人者則不可得志於天下
矣吉事尚左凶事尚右偏將軍居左上將軍居右言以喪禮處之殺人之眾以哀悲泣之戰勝以
喪禮處之道常無名樸雖小天下莫能臣侯王若能守之萬物將自賓天地相合以降甘露民莫
之令而自均始制有名名亦既有夫亦將知210-64-83-167.adsl.dynamic.seed.net.tw海



More information about the Python-list mailing list