Reg Smith wrote:
> 
> my $prev_abs="..\\obj\\gsm_gp_flash_prev.abs";
> my $abs_file="..\\obj\\gsm_gp_flash.abs";
> my $months='(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)';
> 
> # collect the output of NT fc (file compare) command
> $diff_abs = `fc /W $abs_file $prev_abs 2>&1`;
> 
> if($diff_abs =~
> /
> ^Comparing files $abs_file and $prev_abs$
> ^\*\*\*\*\* $abs_file$
> ^%6\.6s %9\.9s$
> ^$months \d{1,2} \d\d\d\d$
> ^\d\d:\d\d:\d\d$
> ^Disconnecting\.\.\.$
> ^\*\*\*\*\* $prev_abs$
> ^%6.6s %9.9s$
> ^$months \d{1,2} \d\d\d\d$
> ^\d\d:\d\d:\d\d$
> ^Disconnecting\.\.\.$
> ^\*\*\*\*\*$
> ^$
> /omi
> )
> {
>   print "file only differ by embedded date\n";
> }
> 

your expression is not going to work. you have the right idea that the /m 
thing will treat your string as multiple lines but you are putting your 
reg. expression in different lines without using the eXtended modifier. for 
example:

#!/usr/bin/perl -w
use strict;

my $k = "ab cd\n1234\nxxx\nyyyy";

if($k =~ /^     ab\ cd\n
                1234\n
                xxx\n
                yyyy
          $/x){

        print "match\n";
}else{
        print "not match\n";
}

__END__

will print match. notice the /x thingy which tell Perl to ignore white 
spaces. so to match white space again, i have to '\ ' between 'ab' and 
'cd'. you don't need to put a bunch of '^' and '$' all over your reg. exp.

david

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to