this is from K&B pg no 483
class Regex
{
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());
}
}
}
using
test run with
%java Regex "\d\w" "ab4 56_7ab"
why it is giving output
4 56
why not: 5 6_ because it is digit then
word not digit digit and then word
thannks in advance