Perl5 and Alternate strange behavior

"Jerome Jacobsen" <[email protected]> Tue, 5 Nov 2002 16:51:49 -0500
Newsgroups gmane.comp.jakarta.oro.user
Message-ID <[email protected]>
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!

However only the first returns true.  If I change my pattern to this:
Pattern pattern = compiler.compile("STUFF|");

Then both Perl5Matcher.matches() calls return true!

Am I misunderstanding something?

-Jerome