You don't have fixed width of line, look behind or look ahead will only work on fixed width
use strict; use warnings; while(my $line = <DATA>) { chomp($line); if( $line =~ /(?<!fee\/src\/)(com\/)/ ) { print $line . "\n"; } } __DATA__ foo/src/com/ foo/src/com/ foo/src/com/ fee/src/com/
In reply to Re: Having a problem with negative look behind assertion
by manorhce
in thread Having a problem with negative look behind assertion
by SirClive
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |