Return-Path: Delivered-To: apmail-jakarta-oro-user-archive@apache.org Received: (qmail 53912 invoked from network); 14 Nov 2002 21:08:16 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 14 Nov 2002 21:08:16 -0000 Received: (qmail 12986 invoked by uid 97); 14 Nov 2002 21:09:18 -0000 Delivered-To: qmlist-jakarta-archive-oro-user@jakarta.apache.org Received: (qmail 12934 invoked by uid 97); 14 Nov 2002 21:09:16 -0000 Mailing-List: contact oro-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "ORO Users List" Reply-To: "ORO Users List" Delivered-To: mailing list oro-user@jakarta.apache.org Received: (qmail 12917 invoked by uid 98); 14 Nov 2002 21:09:16 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Reply-To: From: "Jerome Jacobsen" To: "ORO Users List" Subject: RE: Perl5 and Alternate strange behavior Date: Thu, 14 Nov 2002 16:05:59 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <200211142030.gAEKUCC14836@gandalf.savarese.org> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Sorry I reveal my novice understanding of perlre. What I am looking for is a way to do an exact match, not a contains. For example, let's pretend there is such a method called matchesExact() which would behave as follows for my pattern: Pattern pattern = compiler.compile("|STUFF|JUNK"); matcher.matchesExact("", pattern); // return true matcher.matchesExact(" ", pattern); // return false matcher.matchesExact("STUFF", pattern); // return true matcher.matchesExact("STUFFY", pattern); // return false matcher.matchesExact("JUNK", pattern); // return true matcher.matchesExact("JUNKY", pattern); // return false That is, my input can only be one of "", "STUFF", or "JUNK". Nothing else is valid even if it contains "STUFF" or "JUNK" in its string. Is there a way ORO to do this? Or is there a way to specify this in the pattern itself? -Jerome -----Original Message----- From: Daniel F. Savarese [mailto:dfs@savarese.org] Sent: Thursday, November 14, 2002 3:30 PM To: ORO Users List Subject: Re: Perl5 and Alternate strange behavior In message , "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 -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: