J
Jason C
I have this regex, which works as expected:
a = a.replace(/ itxtHarvested="(.*?)"/i, "");
I modified it to this:
a = a.replace(/\s*itxtHarvested="*(.*?)"*/i, "");
which I thought would be the same, but would make the /s and " optional. But, in practice, instead of just removing it, it was being converted to something like:
441?0?
(Or maybe 530"0"; I had made several modifications using the *, and now I don't remember which error went where.)
Does the * not mean "0 or more times" in Javascript like it does in other languages? I know that a few things are different with JS (like the /s modifier), so I wasn't sure.
Or, is it just something flawed in my logic that made it not work as expected?
a = a.replace(/ itxtHarvested="(.*?)"/i, "");
I modified it to this:
a = a.replace(/\s*itxtHarvested="*(.*?)"*/i, "");
which I thought would be the same, but would make the /s and " optional. But, in practice, instead of just removing it, it was being converted to something like:
441?0?
(Or maybe 530"0"; I had made several modifications using the *, and now I don't remember which error went where.)
Does the * not mean "0 or more times" in Javascript like it does in other languages? I know that a few things are different with JS (like the /s modifier), so I wasn't sure.
Or, is it just something flawed in my logic that made it not work as expected?