A regex to detect string not enclosed in double quotes

前端 未结 3 1777
一个人的身影
一个人的身影 2020-12-16 01:25

I have a string something like this

\"quick\" \"brown\" fox jumps \"over\" \"the\" lazy dog

I need a regex to detect words not enclosed in doubl

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-16 01:45

    use this regex:

    \s+(?([^\"\s]+)*)\s+
    

    this should be work; and get group named myword. else you need to trim your result string.

提交回复
热议问题