From: Eric Christopherson Date: 2013-01-31T12:26:27+09:00 Subject: Re: How backtracking works in Ruby? On Fri, Jan 18, 2013 at 10:01 AM, Arup Rakshit wrote: > Hi, > > > What i am going to ask is very basic thing I know. But,as a newbie to > this platform,I am not getting the keen concept of backtracking in Regex > of Ruby. In such a case can any one help me to understand the core of > this concept by answering the following questions? > > (a) What is backtracking? > > (b) Why we need it?(means how regex with backtracking differs from a > regex without backtracking?) > > (c) How it works when it is being used with any Regex? (It would be > great if it can be visualized with some code snippets to understand how > does it work) > > (d) In what situation we have to think of it to use? > > > I used the link( http://ruby-doc.org/core-1.9.3/Regexp.html ) to get > it's core,but my bad i am not getting the answers of all my above > questions from here to have the concept. This freely-available chapter from _Mastering regular expressions_ talks about backtracking, although it doesn't mention Ruby specifically: http://oreilly.com/catalog/regex/chapter/ch04.html