RegEx: Grabbing values between quotation marks

前端 未结 20 1275
暖寄归人
暖寄归人 2020-11-22 02:13

I have a value like this:

\"Foo Bar\" \"Another Value\" something else

What regex will return the

20条回答
  •  故里飘歌
    2020-11-22 02:48

    If you're trying to find strings that only have a certain suffix, such as dot syntax, you can try this:

    \"([^\"]*?[^\"]*?)\".localized

    Where .localized is the suffix.

    Example:

    print("this is something I need to return".localized + "so is this".localized + "but this is not")

    It will capture "this is something I need to return".localized and "so is this".localized but not "but this is not".

提交回复
热议问题