ankur kothari wrote:are there any [good] articles on regex and greedy quantifiers?
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Minhaj kaimkhani wrote: import java.util.regex.*; class Regex{ public static void main(String... args){ String pattern = "\\d\\w"; String matcher = "ab4 56_7ab"; Pattern p = Pattern.compile(pattern); Matcher m = p.matcher(matcher); System.out.println("Pattern is: " + m.pattern()); while(m.find()){ System.out.println(m.start() + " " + m.group()); } } } out put Pattern is: \d\w 4 56 7 7a anyone can explain the output please? I read the above expression as "match any digit followed by 1 white space".