On Sep 30, 2004, at 9:55 AM, Wiggins d Anconia wrote:

Out of curiousity based on your description shouldn't it return,

1111:2222:3333:5555:5555:6666:7777:8888

Or do you really mean, you are trying to capture all 4 digit strings
that are not in a string of longer digits? You need to be very explicit
about what you are after.




The example was intended to resolve the ambiguities of my informal description :-) You correctly surmised what I was after.


my @a = ($foo =~ m'(?<!\d{4})\d{4}(?!\d)'g);

And your solution works. Now I'm going to study up on *how* it works!

Thanks, and also thanks to Dave and Gunnar for what appears to be the same solution, and the references to extended patterns and zero-width assertions.

Chap


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to