Hi everybody, We noticed that the LPI Essentials V1.5 still have the following item: in: 3.2 Searching and Extracting Data from Files under: Key Knowledge Areas Basic Regular Expressions using ., [ ], *, and ?
The problem is that '?' is not part of the Basic Regular Expressions at all, so this requirement is a contradiction in terms. The '?'is a part of the Extended Regular Expressions, but i.m.h.o. things get too complicated for a beginners level if we have to touch on the difference between thasee two. Just a few examples, exercising this '?' meaning: "zero or one of the preceding", and using curly brackets to obtain a similar "range from.. to..." effect: BRE: echo papa | grep 'papa?' -> no output ERE: echo papa | grep -E 'papa?' -> output: papa BRE: echo papa | grep 'papa\{0,1\}' -> output papa ERE: echo papa | grep -E 'papa{0,1}' -> output papa My suggestion: drop the '?' (and don't introduce the curly brackets). However: I dearly miss the ^ and $ anchors, and in my opinion the [^....] is indispensable as well. Hendrik-Jan -- Hendrik-Jan Thomassen <h...@atcomputing.nl> AT Computing Linux/UNIXperts, opleiders & oplossers Tel +31 24 352 72 82 Kerkenbos 1238 Tel cursussecretariaat: +31 24 352 72 72 6546 BE Nijmegen Fax +31 24 352 72 92 i...@atcomputing.nl www.atcomputing.nl 'If you think education is expensive, try ignorance.' _______________________________________________ lpi-examdev mailing list lpi-examdev@lpi.org http://list.lpi.org/cgi-bin/mailman/listinfo/lpi-examdev