JavaScript Regex Global Match Groups

前端 未结 7 760
感动是毒
感动是毒 2020-11-28 10:50

Update: This question is a near duplicate of this

I\'m sure the answer to my question is out there, but I couldn\'t find the words to express it suc

7条回答
  •  一个人的身影
    2020-11-28 11:38

    Not very generic solution since lookbehind isn't supported in Javascript but for given input this regex should work:

    m = input.match(/([^',]+)(?=')/g);
    //=> ["Warehouse", "Local Release", "Local Release DA"]
    

提交回复
热议问题