fork download
  1. use strict;
  2.  
  3. my $str = '3:K1675
  4. 4:K1663
  5. 5:K1663
  6. 6:K1663
  7. 7:K1663
  8. 8:K1675
  9. 13:K1675
  10. 14:K1675';
  11. my $regex = qr/^(\d+):(?!K1663$)(.*)$/mp;
  12.  
  13. while( $str =~ /$regex/g )
  14. {
  15. print "$1 $2 \n";
  16. }
  17.  
  18.  
Success #stdin #stdout 0s 17496KB
stdin
Standard input is empty
stdout
3 K1675 
8 K1675 
13 K1675 
14 K1675