undef $/; while ( /^(\d+-\d+-\d+.*?keyword)(?!\d+-\d+)$/smg ) { print "$1\n"; }