zero width lookahead match
- From: sharan.basappa@xxxxxxxxx (Sharan Basappa)
- Date: Wed, 30 May 2007 17:27:56 +0530
Hi All,
I have some background working with scanners built from Flex. And I have
used lookahead capability of flex many a times. But I dont understand the
meaning of ZERO in zero lookahead match rule i.e. (?=pattern)
For example, to capture overlapping 3 digit patterns from string $str =
123456
I use the regex @store = $str =~ m/(?=(\d\d\d))/g;
So here the regex engine actually looks ahead by chars digits.
The other question I have is - how does regex engine decide that it has to
move further its scanner by 1 character everytime since I get output 123 234
345 456
when I run this script ?
Regards,
Sharan
- Follow-Ups:
- Re: zero width lookahead match
- From: Rob Dixon
- Re: zero width lookahead match
- From: Chas Owens
- Re: zero width lookahead match
- Prev by Date: Re: Outlook CSV Parser
- Next by Date: Re: encode UTF8 -> MIME
- Previous by thread: Outlook CSV Parser
- Next by thread: Re: zero width lookahead match
- Index(es):
Relevant Pages
|
|