reg是用飞机建造的,但我将其产出到火上:
(.{1,38})(+|$
?)
错误
invalid quantifier +|$
?)
我不敢确定何时开始。
实际守则是:
var re = top.RegExp;
var regex = new re("(.{1," + len + "})(+|$\n?)", "gm");
UPDATE: Per Bennor McCarthy s instructions, I changed the code to this:
var regex = new re("(.{1," + len + "})(+|$\n?)", "gm");
消防队仍然告诉我:
invalid quantifier +|$
?)
[Break on this error] var regex = new re("(.{1," + len + "})(+|$\n?)", "gm");
ANOTHER UPDATE Looks Like I had to double slash it and this solved the problem!
final code
var regex = new re("(.{1," + len + "})(\+|\$\n?)", "gm");