[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non-greedy option greedy?

From: Paolo Bonzini
Subject: Re: Non-greedy option greedy?
Date: Fri, 01 Oct 2010 17:06:02 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100907 Fedora/3.1.3-1.fc13 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.3

On 09/30/2010 04:44 PM, Satyaanveshi wrote:
Bugzilla from address@hidden wrote:

Hi there,
i execute this command in bash (cygwin):

echo CC-3623843-4/2008 | grep -P -o --regexp=-.*?/

and I get this result:


Shouldn it be


Non-greediness doesn't override the "leftmost" rule. The match is always attempted from the beginning of the string, in your case from the first dash.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]