Sorry that I couldn't post the reply after initial explanation.
I was busy in preperation , just cleared the exam with 98%
Coming to question why it gives blank String at index 6 for "ab34ef" while index goes from only 0-5 in given String.
Answer: If we take a String with just 1 character then start index is 0 and endindex is 1, there is no characted at index 1.
String "s" | | index: 0 1
So, in case of String.substring(0,1) it gives "s" which indicates substring with start index of 0 and end index of 1 and exclude end index as there no character at end index. Now, when you apply a greedy quantifier * (0 or more times). It will consume greedily. Since the end index is there without any character it fits in the search criteria.