~/ learn/ comp-325/ cards/ Pinning a match to a position
1 of 9

Word anchor versus line anchor, on the same fixture

Word anchor versus line anchor, on the same fixture

Answer

grep '\<Ke' roster grep '\<K' roster grep '^K' roster

Two lines, then three, then two again. Dropping the e adds Kowalski, whose capital K starts a word mid-line; switching to the line anchor drops it again. That single line in the fixture is what separates the two anchors.

Sarwar & Koretsky 3e ch7 §7.5–7.6; POSIX.1-2024 XBD §9.3.5 (bracket expressions)

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/9f5617de-3270-421a-a690-5418cb61d54a/flashcard utf-8 LF