Sandeep Vaid
,
Ranch Hand
Oct 02, 2006 11:07:00
source : "1 a12 234 b" pattern : \d+ It prodces the output as 036 but in Kathy Seria's book (P-477) it's written that it produces 0 1 3 12 6 234
Barry Gaunt
,
Ranch Hand
Oct 02, 2006 12:40:00
Running the program on page 483 gives: You have the 0, 3, 6 (start positions) correctly, where are your groups?
Sandeep Vaid
,
Ranch Hand
Oct 02, 2006 22:44:00
On Page 483, the pattern is /d/w and not /d+. My Question is : On page 477, using /d+ as pattern he produces the output as 0 1 3 12 6 234 is that incorrect ?
Barry Gaunt
,
Ranch Hand
Oct 02, 2006 23:00:00
As I wrote,running the program on 487 with source : "1 a12 234 b" pattern: \d+ produces 0 1 3 12 6 234 [ October 02, 2006: Message edited by: Barry Gaunt ]
Sandeep Vaid
,
Ranch Hand
Oct 02, 2006 23:16:00
I got it. It's the Matcher group() method which produces that output. Then surely there is a mistake in kathy's book on p - 477....
Sandeep Vaid
,
Ranch Hand
Oct 02, 2006 23:19:00
Originally posted by Sandeep Vaid: I got it. It's the Matcher group() method which produces that output.
You don't like waffles? Well, do you like this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com