true: Pattern p=new Pattern("\\w+"); p.matcher("a").matches(); p.matcher("ab").matches(); p.matcher("abc").matches();
and the following yields the false: p.matcher("abc def").matches(); p.matcher("bcd ").matches(); p.matcher(" bcd").matches(); p.matcher("#xyz#").matches();
@return whether a current target matches the whole pattern.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|