- 359 名前:名無しさん@お腹いっぱい。 mailto:sage [2009/12/19(土) 21:29:06 ID:PGTd1HdbP]
- あぁなるほどエスケープするようにしておけば良かったね
var constring = "[固定の文字列]"; var constregex = new RegExp("^" + constring.replace(/\W/g,"\\$&") + "\\s(.*)$"); var buff = "", temp = []; for(var l = 1; l <= document.GetLines(); l++) { if(document.GetLine(l).match(constregex)) { temp.push(RegExp.$1, document.GetLine(++l)); } if(temp.length == 6 || l >= document.GetLines()) { buff += temp.join(" ") + "\n"; temp.length = 0; } } editor.NewFile(); document.write(buff);
|

|