crossscript and javascript regular expression match and split
Hi,
i like to grep the hexnumber from the buildnum.h file i tryed it with split and with match but both give me undefined back.
buildnum.h contens: #define BUILDNUMBER 0x01080000 /*version - fill it here*/
the script file: var file = "buildnum.h"; var text = "#define BUILDNUMBER 0x"; var s = CWSys.readStringFromFile(file); var n; if (s == undefined) n = 1; else // n = eval(s.substring(text.length)) + 1; // n = s.split(" "); // n = eval(n[2]);
result = s.match("/\b0[xX][0-9a-fA-F]+\b/g"); CWSys.writeStringToFile(file, text + result + " /*version - fill it here*/ \r\n");
Please sign in to leave a comment.
Comments
0 comments