[lug] Another sed question

David L. Anselmi anselmi at anselmi.us
Sun Feb 5 22:20:52 MST 2006


Tkil wrote:
[...]
> The behavior you were expecting (that the digits would be "consumed"
> and not "given back") is associated with "atomic capture" or
> "possessive quantifiers" in sufficiently advanced RE engines.
> 
> In Perl, this should do the trick:
> 
>    perl -nlwe '/^(?>R\d{1,3})(?:[^E].*|)$/ && print' list

Heh.  When this thread started I began a reply:

"If you keep asking sed questions the answer will eventually be 'use 
perl'".  But I didn't have an answer as complete as Tkil so I'm glad I 
didn't say anything.

Dave



More information about the LUG mailing list