
Stefanik
User
Jan 17, 2013, 1:37 PM
Views: 1913
|
|
Re: [FishMonger] Match characters in middle and end string
|
|
|
doesn't work Input:
meSUBstring1; youSUBstring2; ISUBstring3 string4; noSUBstring5; code:
#!/usr/bin/perl use strict; use warnings FATAL => qw(all); use diagnostics; my $qnso="C:/Users/me/Desktop/Perl_Test/temp/test.log"; my $qpar="x"; open (NSOFILE, "<", $qnso) or die "No file!"; while ($qpar = <NSOFILE>){ if ($qpar =~ /SUB.*[^;]\n?/m){print $qpar;} } close (NSOFILE); Output:
meSUBstring1; youSUBstring2; ISUBstring3 noSUBstring5;
(This post was edited by Stefanik on Jan 17, 2013, 1:38 PM)
|