CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [FishMonger] Match characters in middle and end string: Edit Log



Stefanik
User

Jan 17, 2013, 1:37 PM


Views: 13548
Re: [FishMonger] Match characters in middle and end string

doesn't work Frown

Input:

Code
meSUBstring1; 
youSUBstring2;
ISUBstring3
string4;
noSUBstring5;


code:

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:

Code
meSUBstring1; 
youSUBstring2;
ISUBstring3
noSUBstring5;



(This post was edited by Stefanik on Jan 17, 2013, 1:38 PM)


Edit Log:
Post edited by Stefanik (User) on Jan 17, 2013, 1:38 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives