Extract string from between quotations

前端 未结 3 2032
礼貌的吻别
礼貌的吻别 2020-12-25 11:08

I want to extract information from user-inputted text. Imagine I input the following:

SetVariables \"a\" \"b\" \"c\"

How would I extract in

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-25 12:06

    >>> import re
    >>> re.findall('"([^"]*)"', 'SetVariables "a" "b" "c" ')
    ['a', 'b', 'c']
    

提交回复
热议问题