1
casparchen 2014-04-13 22:53:41 +08:00
为嘛不正则式
|
2
JoyNeop 2014-04-14 06:37:57 +08:00
var a1 = raw.slice(0, raw.indexOf('[')) + raw.slice(raw.indexOf(']') + 1)
var zhi = raw.slice(13, 14) var paper = raw.slice(raw.indexOf(';') + 1) var out = 'variant of <a href="search?id=' + zhi + '">' + zhi + '; ' + paper + '</a>' |
3
Mutoo 2014-04-14 09:26:23 +08:00
var str = "variant of 紙|纸[zhi3]; paper;";
var zhi = str.split(" ")[2].split("|")[1].split(/[\[\]]/)[0]; var paper = str.split(" ")[3].split(";")[0]; |