logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: [Boston.pm] quantifiers in regular expressions: msg#00008

Subject: Re: [Boston.pm] quantifiers in regular expressions
On Wed, Feb 01, 2006 at 02:55:19PM -0500, Greg London wrote:
> I'm trying to understand how multiple quantifiers in a 
> regular expressions get massaged to fit the data.

The Mastering Regular Expressions book has a chapter on the Mechanics of
Regular Expressions which might be helpful.

Basically, the regex engine keeps track of every decision it makes (such as
whether or not to match an additional iteration for the * quantifier).
When the matching fails, the regex engine backtracks to the last decision
it made and tries the other choice.

Ronald



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>