Raj Purushotham

Greenhorn
+ Follow
since Apr 15, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Raj Purushotham

Hi Abimaran,

Thank you for the respose. I tried with + istead of * and the results are same.

I can see that if I use "\d?" for the source a23a12 it gives me what I suspect

1space23
4space12

How ever if I use "\d*" for the source a23a12 it gives me the following:
0space
1space23
3space
4space12
6space

"6space" is not clear to me.


Hi,

I am not clear on the Regex question (page 508 Question 1) from K&B 5 book

To uderstad I tried writing a similar program.

Lets say I give the followig commad line Java Regex "\d*" a
I get

0space
1space

I see that it is searchig for digits ad it finds 0 matches first time and prints postion 0 (search index 0). Then because we said * the start method returns to the previous index 0 now how come it goes to the postion 1 when there is only 1 charecter in the search strig.