use strict; my $keyword = "START"; my $length = 20; my $file = <<EOF; something START text1 text2 ........................ text 3 text 4 START more text still more text EOF $file =~ s/(?:\s+|\n+)//gc; my @hits = $file =~ /$keyword(.{$length})/g; for (@hits) { print $_."\n"; }
In reply to Re: Extracting text after a keyword
by amphiplex
in thread Extracting text after a keyword
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |