import java.util.regex.*;
class Regex2{
public static void main(
String[] args){
Pattern p=Pattern.compile(args[0])
Matcher m=p.matcher(args[1]);
boolean b=false;
while(b=m.find()){
System.out.println(m.start()+m.group()+"");
}
}
}
and we give
java Regex2 "\d\s\w" "12s 4w 33 1"
output for this is: 44 w 93
Can anyone explain me this. And i don't have much idea on this regex class also. can anyone provide clear explanation about this topic.
Thanks in Advance.