Rob Dixon wrote:
>
> As far as lookahead expressions are concerned, Perl functions identically
> to Flex. It is called zero-width lookahead because it matches a zero-width
> /position/ in the string instead of a sequence of characters. If I write
>
> '123456' =~ /\d\d\d(...)/
>
> then '456' will
Its the same logic - continue after first substitution/match.
In case of subst.. it continues and in case of regex, the search
continues after first match until the complete string is exhausted
On 30 May 2007 22:54:39 -0700, jeevs <[EMAIL PROTECTED]> wrote:
> $ perl -wle'
> $string = "abc";
> w
> $ perl -wle'
> $string = "abc";
> while ($string =~ /(.*?)/g) {
> print pos($string), ": ", $1;}
>
> '
> 0:
> 1: a
> 1:
> 2: b
> 2:
> 3: c
> 3:
>
Can someone explain the working of the g modifier since my knowledge
of using g was to use it for substituting globally...
Here i get what paul is t
On 30 May 2007 08:53:54 -0700, Paul Lalli <[EMAIL PROTECTED]> wrote:
snip
I got confused by this too. I think Sharan's question comes down to
"why isn't this an infinite loop?" That is, why does pos() move ahead
one character when it matches 0 characters? This is not limited to
look-ahead asse
On May 30, 10:02 am, [EMAIL PROTECTED] (Chas Owens) wrote:
> On 5/30/07, Sharan Basappa <[EMAIL PROTECTED]> wrote:
> > You mention that if I write a rule like @store = $str =~ m/((?=\d\d\d))/g;
> > then the scanner does not move ahead. But as I mentioned in my mail,
> > the result of this regex is
Thanks Rob and Chas ..
On 5/30/07, Rob Dixon <[EMAIL PROTECTED]> wrote:
Sharan Basappa wrote:
>
> 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
Sharan Basappa wrote:
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 fr
On 5/30/07, Sharan Basappa <[EMAIL PROTECTED]> wrote:
>> this is what the zero-width lookahead assertion means. It say with
>>out moving where you are currently starting the match, make certain
>>you can match the following pattern. If you want it to move where the
>>match starts then you have
this is what the zero-width lookahead assertion means. It say with
out moving where you are currently starting the match, make certain
you can match the following pattern. If you want it to move where the
match starts then you have to include something that does not have
zero-width like this
On 5/30/07, Sharan Basappa <[EMAIL PROTECTED]> wrote:
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)
snip
You may also prefe
On 5/30/07, Sharan Basappa <[EMAIL PROTECTED]> wrote:
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)
snip
I don't know jack
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
12 matches
Mail list logo