How to capture multiple repeated groups?

前端 未结 7 1627
傲寒
傲寒 2020-11-22 10:59

I need to capture multiple groups of the same pattern. Suppose, I have a following string:

HELLO,THERE,WORLD

And I\'ve written a following

7条回答
  •  再見小時候
    2020-11-22 11:17

    I think you need something like this....

    b="HELLO,THERE,WORLD"
    re.findall('[\w]+',b)
    

    Which in Python3 will return

    ['HELLO', 'THERE', 'WORLD']
    

提交回复
热议问题