Chap Harrison wrote on 30.09.2004:

>
>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);
>
Careful, you mistyped the original proposition:

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

This one will find a string consisting of four digits, neither preceded nor followed 
by a digit. In other words: exactly four digits. Your quote will find a string of four 
digits not preceded by another four digits, so it could find a string of five, six or 
seven digits.

- Jan
-- 
How many Microsoft engineers does it take to screw in a lightbulb? None. They just 
redefine "dark" as the new standard.

--
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