In article <[EMAIL PROTECTED]>, Richard Lee
<[EMAIL PROTECTED]> wrote:
> While reading 'mastering perl', I run into @- and @+ for the first time.
> Trying to understand what's going on, I ran the code from the book, but
>
> $-[1] and $+[1] shoudln't match only the first match? (in this case,
> sh
John W. Krahn wrote:
Richard Lee wrote:
Thanks John for detailed explanation!!
I just dont' understand why \ (also didn't know that within [ ], \
has to be escaped.) needs to be watch out for within " " ..
\ use can be tricky, for example:
$ perl -le"print 'hello'"
hello
$ perl -le"print '
Richard Lee wrote:
Thanks John for detailed explanation!!
I just dont' understand why \ (also didn't know that within [ ], \ has
to be escaped.) needs to be watch out for within " " ..
\ use can be tricky, for example:
$ perl -le"print 'hello'"
hello
$ perl -le"print 'he\llo'"
he\llo
$ perl
John W. Krahn wrote:
Richard Lee wrote:
Took your advice and start to read 'Mastering regular expression' by
Jeffrey E.F.Friedl,
Can you explain below further?
on page, 205
push(@fields, $+) while $text =~ m{
"([^\"\\]*(?:\\.[^\"\\]*)*)",? #standard quoted string(with
possible co
Richard Lee wrote:
Took your advice and start to read 'Mastering regular expression' by
Jeffrey E.F.Friedl,
Can you explain below further?
on page, 205
push(@fields, $+) while $text =~ m{
"([^\"\\]*(?:\\.[^\"\\]*)*)",? #standard quoted string(with
possible comma)
| ([^,]+),?
Say you have the string "abcdefghi".
The positions in the string are:
a b c d e f g h i
^ ^ ^ ^ ^ ^ ^ ^ ^ ^
0 1 2 3 4 5 6 7 8 9
If you have the regular expression:
/(de)/
Then the match starts at position 3, moves forward two characters, and
ends at position 5, where the next match, i
Rob Dixon wrote:
Richard Lee wrote:
Rob Dixon wrote:
Perhaps it would help to think of the offset as being the index of the
points between the characters, so the start of the string is at offset
zero, after 'a' (and before 'b') is at offset one and so on. Then can
you see how offset 7 is befor
Richard Lee wrote:
Rob Dixon wrote:
Perhaps it would help to think of the offset as being the index of the
points between the characters, so the start of the string is at offset
zero, after 'a' (and before 'b') is at offset one and so on. Then can
you see how offset 7 is before 'hi' and offset
Richard Lee wrote:
John W. Krahn wrote:
Richard Lee wrote:
While reading 'mastering perl', I run into @- and @+ for the first time.
perldoc perlvar
Trying to understand what's going on, I ran the code from the book, but
$-[1] and $+[1] shoudln't match only the first match? (in this case,
Rob Dixon wrote:
Richard Lee wrote:
John W. Krahn wrote:
Richard Lee wrote:
While reading 'mastering perl', I run into @- and @+ for the first
time.
perldoc perlvar
Trying to understand what's going on, I ran the code from the book,
but
$-[1] and $+[1] shoudln't match only the first mat
Richard Lee wrote:
John W. Krahn wrote:
Richard Lee wrote:
While reading 'mastering perl', I run into @- and @+ for the first time.
perldoc perlvar
Trying to understand what's going on, I ran the code from the book, but
$-[1] and $+[1] shoudln't match only the first match? (in this case,
John W. Krahn wrote:
Richard Lee wrote:
While reading 'mastering perl', I run into @- and @+ for the first time.
perldoc perlvar
Trying to understand what's going on, I ran the code from the book, but
$-[1] and $+[1] shoudln't match only the first match? (in this case,
shoudln't it be, 7 t
Richard Lee wrote:
While reading 'mastering perl', I run into @- and @+ for the first time.
perldoc perlvar
Trying to understand what's going on, I ran the code from the book, but
$-[1] and $+[1] shoudln't match only the first match? (in this case,
shoudln't it be, 7 to 8 ?, instead of 7 to
13 matches
Mail list logo