Re: Perl5 and Alternate strange behavior

"Daniel F. Savarese" <[email protected]> Thu, 14 Nov 2002 15:30:12 -0500
Newsgroups gmane.comp.jakarta.oro.user
Message-ID <[email protected]>
In message <[email protected]>, "Jero
me Jacobsen" writes:
>I have a Pattern like this:
>Pattern pattern = compiler.compile("|STUFF");
>
>I would expect both of the following to return true:
>matcher.matches("", pattern);       // returns true
>matcher.matches("STUFF", pattern);  // returns false!

matches() is not the same as contains() and matches(input, "pattern")
is not the same as matches(input, "^pattern$").  Look at the "Note:"
in the javadocs for Perl5Matcher.matches() for an explanation.

daniel