On Tue, Dec 30, 2014 at 9:59 AM, Zeeshan Jan <[email protected]> wrote:
> Hi All,
> I am trying to learn and understand the regular expressions in javascript
> and would like to understand the concept of backtracking for regular
> expressions in javascript. Can anyone point me to the source code or refer
> me to the algorithm which javascript in Google Chrome (V8 Engine) uses to
> parse regular expressions and to check how does it backtrack. As Google's V8
> Engine is Open Source this must not be difficult.

Backtracking in V8 is implemented using a stack.  The relevant files
are in src/*regex*; it's part JS, part C++.

It's worth mentioning that irregexp, the regular expression parser,
normally emits native code but it also has a bytecode interpreter.  I
don't think the interpreter is currently used (maybe by the
out-of-tree PPC port) unless you build with v8_interpreted_regexp=1.

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to