in reply to Re^2: Quick Regex trouble
in thread Quick Regex trouble

I think it's actually look-behind assertion he needs.

I don't think so. The OP said that it should match "neighbor" but not "use neighbor", so that a zero-width negative look-behind assertion seems to be what is needed to exclude "use".

Just an additional note: the do {} block is unnecessary in the OP code. The solution could be:

($var =~/(?<!use )neighbor[[:alpha:]-]* ([[:alnum:]\.-:]+)/) and print $1;

or even:

print $1 if $var =~/(?<!use )neighbor[[:alpha:]-]* ([\d:]+)/;