in reply to RE: RE: Re: How do you match
in thread How do you match
open (FILE2, $file_2) or die "Couldn't open file: $!"; while (<FILE2>) { if ($_ =~ s/^confederation-as-router\:\W+\d\W+\d+\W//) { push(@file2, $_); } } </CODE> Currently, the regex will return:confederation-as-router: 1 2345 atlanta1-cr1 confederation-as-router: 1 2345 atlanta1-cr2 confederation-as-router: 1 2345 atlanta1-cr3 confederation-as-router: 1 2345 atlanta1-cr4 confederation-as-router: 1 2345 atlanta1-cr5 confederation-as-router: 1 2345 atlanta1-cr6 confederation-as-router: 1 2345 atlanta1-sr1
Based upon the above example, I want it to ONLY return:atlanta1-cr1 atlanta1-cr2 atlanta1-cr3 atlanta1-cr4 atlanta1-cr5 atlanta1-cr6 atlanta1-sr1
Is that clearer?atlanta1-sr1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: RE: RE: Re: How do you match
by Fastolfe (Vicar) on Sep 29, 2000 at 01:04 UTC | |
|
(tye)Re: How do you match
by tye (Sage) on Sep 29, 2000 at 01:04 UTC | |
by Adam (Vicar) on Sep 29, 2000 at 01:10 UTC |