Try wrapping the regexp in a 'while' iteration and using the 'g' operator 
on the end.

eg/
# This is UNtested...but should work. Perl remembers where the 
# last match occurs, and carries on where you left off..
while (/Blk\.*\s*\d{3}(\,*\/*\s*\d{3})*/gi){
   print $&,"\n";
}

Jack
_____________________________________________
> 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=20
>             # ignores the remainder?) once a match is found?
> blk. 444, 444
> blk.555
> blk 666
> blk. 777,   777
> 
> thanks!
> 

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to