On Tue, Oct 4, 2011 at 23:48, André Warnier <a...@ice-sa.com> wrote: >> >>> And, it seems that the Pattern class, and its own .matches() >>> method, does work in the way that a non-exclusively-java programmer >>> would expect, anchors and all. >> >> Does it? >> > > Yes, because if one defines e.g. a Pattern "^abcdef" and uses it via > yesno = Pattern.matches("^abcdef",input); > it will actually match the pattern at the beginning of the string only, > which is what one would expect. Thus > > Pattern.matches("^abc","abcdef"); > > would return true, while this : > > Pattern.compile("^abc").matcher("abcdef").matches() > > would return false (according to what I read in the documentation of > Matcher.matches()). > Not so ? > >>
Well, no, and here you see the incoherency of Java vocabulary vs the rest of the regex world ;) The Javadoc should really read "attempts to match the _whole_ input". Bah. Too late to fix things... -- Francis Galiegue ONE2TEAM Ingénieur système Mob : +33 (0) 683 877 875 Tel : +33 (0) 178 945 552 f...@one2team.com 40 avenue Raymond Poincaré 75116 Paris --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org