|
Re: /i resets $1 on failed matches?
|
Andy Lester
|
Jul 11, 2004 21:11 PDT
|
| | | | This is the answer I sent in:
|
cat b.txt |
perl -ne '/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/i;
print "$1\n" if $1;'
|
Don't use $1 to tell if the regex matched. Instead, do
/...whatever../ and print "$1\n";
xoa
--
Andy Lester => an-@petdance.com => www.petdance.com => AIM:petdance
|
|
 |
|