Javascript Regexp - Match Characters after a certain phrase

后端 未结 5 449
名媛妹妹
名媛妹妹 2020-12-13 03:36

I was wondering how to use a regexp to match a phrase that comes after a certain match. Like:

var phrase = \"yesthisismyphrase=thisiswhatIwantmatched\";
var          


        
5条回答
  •  被撕碎了的回忆
    2020-12-13 04:37

    If you want to get value after the regex excluding the test phrase, use this: /(?:phrase=)(.*)/

    the result will be

    0: "phrase=thisiswhatIwantmatched" //full match
    1: "thisiswhatIwantmatched" //matching group
    

提交回复
热议问题