This is an extract of the Test Objective for 3.API Content
"Write code that uses standard J2SE APIs in the java.util and java.util.regex packages to format or parse strings or streams. For strings, write code that uses the Pattern and Matcher classes and the String.split method. Recognize and use regular expression patterns for matching (limited to: . (dot), * (star), + (plus), ?, \d, \s, \w, , ()). The use of *, +, and ? will be limited to greedy quantifiers, and the parenthesis operator will only be used as a grouping mechanism, not for capturing content during matching"
I am not sure exactly what the bold bit means. Is it possible for someone to clarify it, maybe even with examples.
SCJP 5.0, SCWCD, SCBCD, Oracle Certified Master Enterprise Architect
This will print false, true. The parens apply the ? quantifier to the whole expression in the parens (in the latter case, making the whole phrase "abc" optional), vs. making only the "c" optional in the first case. Hopefully that illustrates the difference. [ September 13, 2007: Message edited by: Peter Mularien ]
Author, Spring Security 3 (the Book), Packt Publishing, 2010