Title: RE: How to escape a "." ?
hi everyone!
thanks in advance for your help. i'm banging my head on this problem:
 
this is my text file named test.html
blk. 111, 111, 111, 111, 111 ...some words...
blk 222, 222   ,222, 222...some words...
blk. 333,333, 333 ...some words  blk.333...
blk. 444, 444...some words...
blk.555...some words...
blk 666...some words...
blk. 777,   777....some words...
 
here's my code:
open(TEST, "test.html") or die "Can't open TEST: $!\n";
while (<TEST>){
if (m/Blk\.*\s*\d{3}(\,*\/*\s*\d{3})*/mi)
{print "$&\n";}
};
 
this is what i get:
 
blk. 111, 111, 111, 111
blk 222, 222   ,222, 222
blk. 333,333
blk. 444, 444
blk.555
blk 666
blk. 777,   777
 
but i would like to be able to get this:
blk. 111, 111, 111, 111
blk 222, 222   ,222, 222
blk. 333,333
blk. 333 # this 2nd occurence in the same line is missing in my output. does perl move on to the next line (and
            # ignores the remainder?) once a match is found?
blk. 444, 444
blk.555
blk 666
blk. 777,   777
 
thanks!

Reply via email to