regex between two special characters

后端 未结 6 1247
花落未央
花落未央 2021-01-26 11:12

Is there a way to replicate this PHP snippet in JQuery or Javascript...



        
6条回答
  •  半阙折子戏
    2021-01-26 11:21

    Is this what you need?

    var value = "some {example}";
    value.match(/{([^}]+)}/); //array[0] = "{example}" --- array[1] = "example"
    

提交回复
热议问题