in reply to regex man they are tough
(untested)foreach $line ( @data ) { $line =~ s/ //gm; $first_part = substr($line, 0, 16); # get first 16 $idx = index( $line, "Search String", 16 ); $second_start = $idx > 30 ? $idx - 30 : 0; if ( $idx != -1 ) { $second_part = substr( $line, $second_start, 30 ); $third_part = substr( $line, $idx+length("Search String"), 30 ); } else { $second_part = $third_part = ""; } $line = ""; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex man they are tough
by tgolf4fun (Novice) on Apr 28, 2005 at 17:31 UTC | |
|
Re^2: regex man they are tough
by cazz (Pilgrim) on Apr 29, 2005 at 14:56 UTC | |
|
Re^2: regex man they are tough
by tgolf4fun (Novice) on Apr 29, 2005 at 16:59 UTC | |
by Transient (Hermit) on Apr 29, 2005 at 17:07 UTC |