3 ms·
Well it's not written in JavaScript, so as the OP said it's either C or C++.
by debacle 13y ago
Well it's not written in JavaScript, so as the OP said it's either C or C++.
- skybrian 13y agoRegular expressions are part of the JavaScript language, so they're as much "written in JavaScript" as any other language construct. The point is that a regular expression compiled by V8 (which is not written in JavaScript) is faster than a regular expression as compiled by some particular C compiler. Of course a C compiler could possibly be written to understand calls to a standard regexp API and compile those to binary.
- rayiner 13y agoThe code that's doing the actual matching is not written in C or C++. It's an internal regex bytecode compiled directly to machine code.