grep and the likes already do that.
Update:
perl -ne'$m|=/regex/?print&&1:0}exit!$m;{' 1234567890123456789012345678901234567 1 2 3
In reply to Re: 'Transparent grep'
by ikegami
in thread 'Transparent grep'
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |