in reply to RE: RE: RE: Re: How do you match
in thread How do you match
You're basically breaking apart by spaces anyway, and if you can assume that each line will follow this pattern, it might be simplest to use split and only use a regular expression to be sure you're working with the right line. Even if you do use a regular expression like yours, it's probably easiest to break it apart anyway:print if !/cr\d$/ && $_ = (split)[3];
or evenif (!/cr\d$/ && s/^confederation-as-router:\W+\d\W+\d\W//) { ... }
if (!/cr\d$/ && ($host, $last) = (split)[0,3]) { print $last if $host eq 'confederation-as-router:'; }
|
|---|