in reply to Quick Regex trouble
Close; you need a negative look-behind assertion:
#!/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; };
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Quick Regex trouble
by 2teez (Vicar) on Jul 16, 2013 at 21:16 UTC | |
by Laurent_R (Canon) on Jul 16, 2013 at 21:28 UTC |
In Section
Seekers of Perl Wisdom