Return-Path: Delivered-To: apmail-jakarta-oro-dev-archive@apache.org Received: (qmail 77808 invoked from network); 18 Jan 2002 20:14:18 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 18 Jan 2002 20:14:18 -0000 Received: (qmail 21072 invoked by uid 97); 18 Jan 2002 20:14:23 -0000 Delivered-To: qmlist-jakarta-archive-oro-dev@jakarta.apache.org Received: (qmail 21049 invoked by uid 97); 18 Jan 2002 20:14:21 -0000 Mailing-List: contact oro-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "ORO Developers List" Reply-To: "ORO Developers List" Delivered-To: mailing list oro-dev@jakarta.apache.org Received: (qmail 21034 invoked by uid 50); 18 Jan 2002 20:14:20 -0000 Date: 18 Jan 2002 20:14:20 -0000 Message-ID: <20020118201420.21033.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: oro-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 5923] - optional parament (?) eats input, causes expression after | not to match X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5923 optional parament (?) eats input, causes expression after | not to match dfs@apache.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID ------- Additional Comments From dfs@apache.org 2002-01-18 12:14 ------- You are using matches() instead of contains(). contains() and matches() are not the same. Your sample Perl program corresponds to a Java program that would use contains(), not matches(). Please read the documentation for the matches() method and also the perlre man page that comes with Perl 5.x to understand why this is not a bug. Look at the part describing foo|foot to understand why a?|b and b|a? do not match the same way. Also, please inquire on oro-user@jakarta.apache.org before reporting a bug through Bugzilla. Here's the relevant part of the perlre man page: Alternatives are tried from left to right, so the first alternative found for which the entire expression matches, is the one that is chosen. This means that alternatives are not necessarily greedy. For example: when matching `foo|foot' against "barefoot", only the "foo" part will match, as that is the first alternative tried, and it suc- cessfully matches the target string. (This might not seem important, but it is important when you are capturing matched text using parentheses.) -- To unsubscribe, e-mail: For additional commands, e-mail: