in reply to (tye)Re: How do you match
in thread How do you match

Why not?
while( <FILE> ) { push @file2, $1 if m/^confederation-as-router:\W+\d\W+\d+\W(?!.*cr\d ++)$/; }
Although I bet you could improve on that further... reducing the .* to something more specific.

Update: I missed the negation in that. oops. I've added it to my regex. Thanks runrig and Tye for pointing that out to me. (For those who missed it, I forgot the ?!)