Hi Ashish,
you have entered Exp "\d\w" "ab4 56_7ab"
The start() method returns the index of the matching pattern in your input string & group() method groups the matching pattern starting from the index position returned by start() method.
\d -search for a digit in the pattern
\w search for a
word in the pattern,a word can be digit,letter or "_"
your output is:
4 56 (your first matching statrs from index 4,that is 5 and second match is 6(digit,letter,"_"))
7 7a (second match starts from index 7,that is 7 and second match is a(digit,letter,"_"))
you might be confuse with the underscore,here underscore is not in the result because the 6 just before underscore is already matched & is not included in the next matching.If you insert a new digit before underscore then you will surely get underscore in the result.
I hope i have provided your answer,if there is any confusion then reply me
Mamta