Hey monks!
I am trying to just get a regex to work but it doesn't do what I am looking for. I want to match anything that has 'neighbor' but not 'use neighbor'. Also, what is before 'use neighbor' varies so I can't really rely on that.
Here is my test code:
#!/usr/bin/perl use strict; use warnings; my $var = "use neighbor 2001:504:0:4::6181:1"; ($var =~/(?!use) neighbor[[:alpha:]-]* ([[:alnum:]\.-:]+)/) and do{ print $1; };
Any ideas would be greatly appreciated! Thanks and have a nice day!
jrvd
In reply to Quick Regex trouble by jrvd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |