Gebhard Dettmar <[EMAIL PROTECTED]> wrote:
>> uptime | perl -pe 's/^.*up (.*?,.*?),.*$/\1/'
> Versteh ich nicht. In dem RegEx Ausdruck lese ich 2 Quantifizierer
> hintereinander, * = keinmal, 1x, oder �fter und dann ? = kein- oder
> einmal. Wozu ist letzteres gut? Warum nicht einfach: (.+,.+)
man perlre:
 By default, a quantified subpattern is "greedy", that is, it will match as
 many times as possible (given a particular starting location) while still
 allowing the rest of the pattern to match.  If you want it to match the
 minimum number of times possible, follow the quantifier with a "?".  Note
 that the meanings don't change, just the "greediness":

           *?     Match 0 or more times
           +?     Match 1 or more times
           ??     Match 0 or 1 time
           {n}?   Match exactly n times
           {n,}?  Match at least n times
           {n,m}? Match at least n but not more than m times



        Christoph


-- 
Haeufig gestellte Fragen und Antworten (FAQ): 
http://www.de.debian.org/debian-user-german-FAQ/

Zum AUSTRAGEN schicken Sie eine Mail an [EMAIL PROTECTED]
mit dem Subject "unsubscribe". Probleme? Mail an [EMAIL PROTECTED] (engl)

Antwort per Email an