develooper Front page | perl.perl5.porters | Postings from February 2018

Re: [perl #132826] Report a Bug - Regex does not play well at99,999.99 number

Thread Next
From:
Scott Fields via perl5-porters
Date:
February 8, 2018 14:30
Subject:
Re: [perl #132826] Report a Bug - Regex does not play well at99,999.99 number
Message ID:
2055744605.5715801.1518028012314@mail.yahoo.com
###################################################################################
if (m/ 99,999\.99/)
#if (m/.\s[0-9][0-9],[0-9][0-9][0-9]\.[0-9][0-9]/)
#if (m/.*?\s[0-9][0-9],[0-9][0-9][0-9]\.[0-9][0-9]/)
 {
      # _99,999.99 (2)
 s/(.*?\s)([0-9]{2},[0-9]{3}\.[0-9]{2})/$1\|$2/;
# s/(.*?\s)([0-9][0-9],[0-9][0-9][0-9](\.)[0-9][0-9])/$1\|$2/;

            print "MATCH 99,999.99\n" ;
            print $_;
            print "\n";
}
###################################################################################


C:\Strawberry>perl k7.pl
MATCH 0.99
3||SCHEDULE A - INCOME|4|1 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |0.99
3||SCHEDULE A - INCOME|4|1 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |0.99
MATCH 9.99
3||SCHEDULE A - INCOME|4|2 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |9.99
3||SCHEDULE A - INCOME|4|2 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |9.99
MATCH 99.99
3||SCHEDULE A - INCOME|4|3 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |99.99
3||SCHEDULE A - INCOME|4|3 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |99.99
MATCH 999.99
3||SCHEDULE A - INCOME|4|4 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |999.99
3||SCHEDULE A - INCOME|4|4 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |999.99
MATCH 9,999.99
3||SCHEDULE A - INCOME|4|5 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |9,999.99
3||SCHEDULE A - INCOME|4|5 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |9,999.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|6 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 99,999.99
3||SCHEDULE A - INCOME|4|6 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 99,999.99
MATCH 999,999.99
3||SCHEDULE A - INCOME|4|7 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |999,999.99
3||SCHEDULE A - INCOME|4|7 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |999,999.99
MATCH 9,999,999.99
3||SCHEDULE A - INCOME|4|8 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |9,999,999.99
3||SCHEDULE A - INCOME|4|8 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |9,999,999.99


Done PASS08 ***

C:\Strawberry>



















###################################################################################
#if (m/ 99,999\.99/)
if (m/.\s[0-9][0-9],[0-9][0-9][0-9]\.[0-9][0-9]/)
#if (m/.*?\s[0-9][0-9],[0-9][0-9][0-9]\.[0-9][0-9]/)
 {
      # _99,999.99 (2)
 s/(.*?\s)([0-9]{2},[0-9]{3}\.[0-9]{2})/$1\|$2/;
# s/(.*?\s)([0-9][0-9],[0-9][0-9][0-9](\.)[0-9][0-9])/$1\|$2/;

            print "MATCH 99,999.99\n" ;
            print $_;
            print "\n";
}
###################################################################################



C:\Strawberry>perl k7.pl
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|1 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 0.99
MATCH 0.99
3||SCHEDULE A - INCOME|4|1 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |0.99
3||SCHEDULE A - INCOME|4|1 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |0.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|2 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 9.99
MATCH 9.99
3||SCHEDULE A - INCOME|4|2 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9.99
3||SCHEDULE A - INCOME|4|2 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|3 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 99.99
MATCH 99.99
3||SCHEDULE A - INCOME|4|3 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |99.99
3||SCHEDULE A - INCOME|4|3 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |99.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|4 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 999.99
MATCH 999.99
3||SCHEDULE A - INCOME|4|4 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |999.99
3||SCHEDULE A - INCOME|4|4 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |999.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|5 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 9,999.99
MATCH 9,999.99
3||SCHEDULE A - INCOME|4|5 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9,999.99
3||SCHEDULE A - INCOME|4|5 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9,999.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|6 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 99,999.99
3||SCHEDULE A - INCOME|4|6 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 99,999.99
MATCH 999,999.99
3||SCHEDULE A - INCOME|4|7 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |999,999.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|7 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |999,999.99
3||SCHEDULE A - INCOME|4|7 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |999,999.99
MATCH 9,999,999.99
3||SCHEDULE A - INCOME|4|8 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |9,999,999.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|8 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9,999,999.99
3||SCHEDULE A - INCOME|4|8 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9,999,999.99


Done PASS08 ***

C:\Strawberry>







###################################################################################
#if (m/ 99,999\.99/)
#if (m/.\s[0-9][0-9],[0-9][0-9][0-9]\.[0-9][0-9]/)
if (m/.*?\s[0-9][0-9],[0-9][0-9][0-9]\.[0-9][0-9]/)
 {
      # _99,999.99 (2)
 s/(.*?\s)([0-9]{2},[0-9]{3}\.[0-9]{2})/$1\|$2/;
# s/(.*?\s)([0-9][0-9],[0-9][0-9][0-9](\.)[0-9][0-9])/$1\|$2/;

            print "MATCH 99,999.99\n" ;
            print $_;
            print "\n";
}
###################################################################################



C:\Strawberry>perl k7.pl
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|1 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 0.99
MATCH 0.99
3||SCHEDULE A - INCOME|4|1 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |0.99
3||SCHEDULE A - INCOME|4|1 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |0.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|2 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 9.99
MATCH 9.99
3||SCHEDULE A - INCOME|4|2 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9.99
3||SCHEDULE A - INCOME|4|2 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|3 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 99.99
MATCH 99.99
3||SCHEDULE A - INCOME|4|3 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |99.99
3||SCHEDULE A - INCOME|4|3 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |99.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|4 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 999.99
MATCH 999.99
3||SCHEDULE A - INCOME|4|4 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |999.99
3||SCHEDULE A - INCOME|4|4 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |999.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|5 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 9,999.99
MATCH 9,999.99
3||SCHEDULE A - INCOME|4|5 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9,999.99
3||SCHEDULE A - INCOME|4|5 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9,999.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|6 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 99,999.99
3||SCHEDULE A - INCOME|4|6 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 99,999.99
MATCH 999,999.99
3||SCHEDULE A - INCOME|4|7 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |999,999.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|7 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |999,999.99
3||SCHEDULE A - INCOME|4|7 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |999,999.99
MATCH 9,999,999.99
3||SCHEDULE A - INCOME|4|8 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |9,999,999.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|8 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9,999,999.99
3||SCHEDULE A - INCOME|4|8 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9,999,999.99


Done PASS08 ***

C:\Strawberry>





###################################################################################
#if (m/ 99,999\.99/)
#if (m/.\s[0-9][0-9],[0-9][0-9][0-9]\.[0-9][0-9]/)
#if (m/.*?\s[0-9][0-9],[0-9][0-9][0-9]\.[0-9][0-9]/)
if (m/.*\s[0-9][0-9],[0-9][0-9][0-9]\.[0-9][0-9]/)
 {
      # _99,999.99 (2)
 s/(.*?\s)([0-9]{2},[0-9]{3}\.[0-9]{2})/$1\|$2/;
# s/(.*?\s)([0-9][0-9],[0-9][0-9][0-9](\.)[0-9][0-9])/$1\|$2/;

            print "MATCH 99,999.99\n" ;
            print $_;
            print "\n";
}
###################################################################################


C:\Strawberry>perl k7.pl
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|1 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 0.99
MATCH 0.99
3||SCHEDULE A - INCOME|4|1 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |0.99
3||SCHEDULE A - INCOME|4|1 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |0.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|2 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 9.99
MATCH 9.99
3||SCHEDULE A - INCOME|4|2 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9.99
3||SCHEDULE A - INCOME|4|2 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|3 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 99.99
MATCH 99.99
3||SCHEDULE A - INCOME|4|3 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |99.99
3||SCHEDULE A - INCOME|4|3 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |99.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|4 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 999.99
MATCH 999.99
3||SCHEDULE A - INCOME|4|4 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |999.99
3||SCHEDULE A - INCOME|4|4 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |999.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|5 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 9,999.99
MATCH 9,999.99
3||SCHEDULE A - INCOME|4|5 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9,999.99
3||SCHEDULE A - INCOME|4|5 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9,999.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|6 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 99,999.99
3||SCHEDULE A - INCOME|4|6 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) 99,999.99
MATCH 999,999.99
3||SCHEDULE A - INCOME|4|7 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |999,999.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|7 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |999,999.99
3||SCHEDULE A - INCOME|4|7 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |999,999.99
MATCH 9,999,999.99
3||SCHEDULE A - INCOME|4|8 ||Company Money - dividends 31,024.27 Less foreign tax paid (984.23) |9,999,999.99
MATCH 99,999.99
3||SCHEDULE A - INCOME|4|8 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9,999,999.99
3||SCHEDULE A - INCOME|4|8 ||Company Money - dividends |31,024.27 Less foreign tax paid (984.23) |9,999,999.99


Done PASS08 ***

C:\Strawberry>






C:\Strawberry>perl -v

This is perl 5, version 26, subversion 1 (v5.26.1) built for MSWin32-x64-multi-thread

Copyright 1987-2017, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.


C:\Strawberry>

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About