Re: 请问一个正则的问题

"大熊" <[email protected]>
Newsgroups gmane.comp.python.chinese
Message-ID <[email protected]>
p = re.compile('[(](.+?)[)]')
a = "(aaa)(bbb)(ccc)"
print p.findall(a)
>>['aaa', 'bbb', 'ccc']

2008/1/17, huang falls <[email protected]>:
>
> Hello !
>
> str="(aaa)(bbb)(ccc)"
>
> 想将其转成一个list :
>
> [ "aaa", "bbb", "ccc" ]
>
> 请问如何做比较合适?
>
> Thanks!
>
> Regards
> Falls
> _______________________________________________
> python-chinese
> Post: send [email protected]
> Subscribe: send subscribe to [email protected]
> Unsubscribe: send unsubscribe to  [email protected]
> Detail Info: http://python.cn/mailman/listinfo/python-chinese




-- 
茫茫人海,你是我的最爱

_______________________________________________
python-chinese
Post: send [email protected]
Subscribe: send subscribe to [email protected]
Unsubscribe: send unsubscribe to  [email protected]
Detail Info: http://python.cn/mailman/listinfo/python-chinese
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.