C
Chen Yang
Hi,
In String class, we can use
boolean matches(String regex)
to deal with string data. But when I write:
String da = new String("function");
System.out.print(da.matches("\bfunction\b"));
And it returns false.
I think \b means a word boundary. So it should return true in this case. I
can't figure out why, plez help me, thanks in advance.
In String class, we can use
boolean matches(String regex)
to deal with string data. But when I write:
String da = new String("function");
System.out.print(da.matches("\bfunction\b"));
And it returns false.
I think \b means a word boundary. So it should return true in this case. I
can't figure out why, plez help me, thanks in advance.