so, with trivial variants on method above:
#!C:/Perl/bin use strict; # no warnings because using uninit values below use Data::Dumper::Simple; use vars qw ( @nomatch $I1 $I2 $I3 $L1 $L2 @data $i $j ); while (<DATA>) { push @data,$_ ; } { while (@data) { $L2 = pop @data; chomp $L2; #print "\$L2 is: $L2\n"; $L1 = pop @data; chomp $L1; #print "\$L1 is: $L1\n"; #find the data here if ( $L1 =~ / \d\d\d # three digits \s+ # one or more whitespace NP # exact string, NP \s+ # one or more whitespace U # exact string, U \s+ # one or more whitespace Pu # exact string, Pu /x # end match, extended && $L2 =~ / (\d\d\d) # three digits \s+ # one or more whitespace (\d\.\d{6}) # digit, period, six digits \s+ # one or more whitespace (\d{6}) # six digits \s+ # one or more whitespace (\d\.\d{6}) # digit, period, six digits /x ) { my $n1 = $1; $I1 = $2; $I2=$3; $I3=$4; print "\n\tIn linepair ENDING with $n1, NP: $I1, U: $I2, Pu: + $I3\n"; } else { push @nomatch,"\n\tNo match on lines $L1\n\t\t\t and $L2\ +n"; } } print "\n\n\t No Match pairs follow\n"; warn Dumper (@nomatch); } __DATA__ 000 NP U Pu 001 1.270000 000001 3.141000 002 Lev N Pu 003 0.13 000001 3.277118 004 NP U Pu 005 1.000220 000002 3.098761 006 Yac S Yb 007 10.33000 000001 90000000 008 NP U Pu 009 2.130000 000140 5.797712

In reply to Re^3: regex help! by ww
in thread regex help! by igotlongestname

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.