|
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:1.9.2.9) 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: -3623843-4/ Shouldn it be -4/
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.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |