Le Monday 10 November 2008 01:38:30 Ian Hilt, vous avez écrit :No. The _lazy_ quantifiers (*?, ??, *?, +?, {...}?) are supported all right. But they should be avoided in general. My wording may be bad, then. They're not greedy, they just don't allow for backtracking. They are more than greedy. Let me explain. Consider "number 42" for instance. If you match it against: * .*(\d+) => $1 would be "2": the * eats everything but _has_ to backtrack for \d+ to get anything, but just one number is enough; * .*?(\d+) => $1 would be "42": as *? is lazy, this means that after each match, it looks to see whether the next element in the regex would match anything; as soon as \d+ matches 4, .*? stops there; * .*+(\d+) => $1 would match nothing! *+ eats everything, but the + afterwards _doesn't allow it to backtrack_. I hope this makes things a little clearer ;) I think the correct term for *+, ++, ?+ etc is "possessive" quantifiers, I'm just not sure. -- Francis Galiegue ONE2TEAM Ingénieur système Mob : +33 (0) 6 83 87 78 75 Tel : +33 (0) 1 78 94 55 52 fge@one2team.com 40 avenue Raymond Poincaré 75116 Paris -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Winkler, Tomas | RE: iwlwifi: fix build bug in "iwlwifi: fix LED stall" |
| Jeff Chua | 2.6.27rc1 cannot boot more than 8CPUs |
git: | |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Andrew Dickinson | tx queue hashing hot-spots and poor performance (multiq, ixgbe) |
| Hugh Dickins | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
