holly all,
I'm studying for my
scjp 1.5, and
pattern matching comes out unfortunately.
I do have some questions :
import java.util.regex.*;
Is this true (My understanding)? : Find me groups of 1 of integer, and when you found one, print me out the index of the found integer based on the
String and the group of 1 integer.
the output in compiler :
However, if i add a * at the back of \\d, which is :
the compiler prints out :
Why is this so? I thought what i'm telling the compiler is "Hey compiler, find me groups which start with a digit, while you're on it, take anymore integers behind the first one and form that into a group. Then move on the next token."
I really hope someone can give me some feedback. My exam is like less than 2 weeks away, and i'm really new on this chapter. My lecturer said that we weren't taught this before, but he skipped it.. I mean, wth. lol