in reply to RE: RE: Re: Help for awk/regex/newbie
in thread Help for awk/regex/newbie

Awk! (pun intended).

Never use $1 unless it's within the context of a conditional based on the success of the match.

Otherwise, you get the previous match. In this case, an empty line would give you a duplicate "first" word from the previous entry!

-- Randal L. Schwartz, Perl hacker

  • Comment on RE: RE: RE: Re: Help for awk/regex/newbie