我需要找出一种方法来通过提供常见的刺痛匹配来获取字符串的一部分。代码设置为: http://jsfiddle.net/rexonms/0s7cgxku/
Javascript
----------
findIds(txt);
var ids = [];
var txt = "And all I need is the fan-page-id-xx and also the fan-page-id-yy but not fan-page."
function findIds(txt){
var word = txt.match(/fan-page-id/m); //how do I get the ids (xx, yy) from here?
var id = 'x';
ids.push(id);
console.log(ids)
}