I need to parse JavaScript source code and match all regular expressions with the help of a regular expression :). First I tried this regular expression:
(?:\/.*\/)
But it does not work if the regular expression contains slash, like in the next source code
while (line.match(/[+*/]/))
line = line.replace(/([+*/])\s(\d+)\s(\d+)/, function (s, op, a, b) {
return operators[op](+a, +b);
});
I don`t know how to keep all possibilities in one regular expression. Is there any way to match a regular expression in javascript source code using regular expressions?