From oro-userdcarr@example.net Tue May 07 00:00:41 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 67979 invoked from network); 7 May 2002 00:00:40 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 7 May 2002 00:00:40 -0000
Received: (qmail 7258 invoked by uid 97); 7 May 2002 00:00:47 -0000
Delivered-To: dcarr@example.net
Received: (qmail 7197 invoked by uid 97); 7 May 2002 00:00:46 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 7179 invoked by uid 98); 7 May 2002 00:00:45 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Message-ID: <001501c1f55a$2a971250$84992540@xptfederman>
Reply-To: "Todd Federman" <dcarr@example.net>
From: "Todd Federman" <dcarr@example.net>
To: <dcarr@example.net>
Subject: processing non-english characters
Date: Mon, 6 May 2002 17:00:13 -0700
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Rcpt-To: <dcarr@example.net>
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

The code below behaves correctly in Windows XP with ORO version 2.0.6. The
substitute method returns 0 and the string does not change (the e with the
accent in the input string does not match the e with the backward accent in
the substitution pattern.)

The same code in Solaris with 2.0.6 does perform one substitution and the
resulting string is "abcdf". Is there a system library or something I need
to upgrade that prevents ORO from handling the special characters? Or is
there a gap somewhere in my understanding? If I load the java source code in
vim, I do see the two e's correctly, with their respective accents.

Thanks in advance for any help. I've browsed the archive and haven't seen
this discussed.

Todd

import org.apache.oro.text.perl.Perl5Util;

public class perltest {

    public static void main(String[] args) {

        Perl5Util util = new Perl5Util();

        String input = "abcdéf";
        StringBuffer result = new StringBuffer();

        int numSubs = util.substitute(result, "s#è##g", input);

        System.out.println("num: " + numSubs); // returns 0 in windows, 1 in
solaris
        System.out.println(input);
        System.out.println(result);  // returns the input string in windows,
"abcdf" in solaris
    }
}


--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Tue May 07 07:47:26 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 66311 invoked from network); 7 May 2002 07:47:25 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 7 May 2002 07:47:25 -0000
Received: (qmail 339 invoked by uid 97); 7 May 2002 07:47:17 -0000
Delivered-To: dcarr@example.net
Received: (qmail 165 invoked by uid 97); 7 May 2002 07:47:16 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 135 invoked by uid 98); 7 May 2002 07:47:14 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Message-Id: <dcarr@example.net>
X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4
To: "ORO Users List" <dcarr@example.net>
Subject: Re: processing non-english characters 
In-reply-to: Your message of "Mon, 06 May 2002 17:00:13 PDT."
             <001501c1f55a$2a971250$84992540@xptfederman> 
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Date: Tue, 07 May 2002 03:47:17 -0400
From: "Daniel F. Savarese" <dcarr@example.net>
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N


In message <001501c1f55a$2a971250$84992540@xptfederman>, "Todd Federman" =
writes
:
>The code below behaves correctly in Windows XP with ORO version 2.0.6. T=
he
=2E..
>The same code in Solaris with 2.0.6 does perform one substitution and th=
e

Whenever you run into a situation like this where a Java library with
no platform-dependent code or behavior produces different results for
the same program on two different platforms, the problem does not lie
in the library, but something external to it.  It looks like the problem
is happening at compilation time.  You may want to use a unicode escape
if you can't get the Java compiler on Solaris to do the right thing.  You=
r
problem may have something to do with your locale settings.  For what it'=
s =

worth, your program prints the same two strings for me on Linux.

daniel



--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Tue May 07 16:59:01 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 28566 invoked from network); 7 May 2002 16:59:01 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 7 May 2002 16:59:01 -0000
Received: (qmail 3360 invoked by uid 97); 7 May 2002 16:59:02 -0000
Delivered-To: dcarr@example.net
Received: (qmail 3325 invoked by uid 97); 7 May 2002 16:59:01 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 3313 invoked by uid 98); 7 May 2002 16:59:01 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Date: Tue, 7 May 2002 20:57:57 +0400
From: óÅÒÇÅÊ óÁÍÏÈÏÄËÉÎ <dcarr@example.net>
X-Mailer: The Bat! (v1.48e) Personal
Reply-To: óÅÒÇÅÊ óÁÍÏÈÏÄËÉÎ <dcarr@example.net>
Organization: Gold Globe Electronics JSC
X-Priority: 3 (Normal)
Message-ID: <dcarr@example.net>
To: "ORO Users List" <dcarr@example.net>
Subject: performance
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 8bit
X-MDRemoteIP: 83.161.120.155
X-Return-Path: dcarr@example.net
X-MDaemon-Deliver-To: dcarr@example.net
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

Hello, ORO users!

Has anyone run any perfomance comparisons between
oro package and other regex libraries, i'm especially
interested in oro vs. java.util.regex on jdk1.4.

Any data (microtests, perception, etc.) would be helpful, thanks.
ASAP, please.

-- 
Best regards,
 Sergey                          mailto:dcarr@example.net



--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Fri May 10 00:48:43 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 8397 invoked from network); 10 May 2002 00:48:43 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 10 May 2002 00:48:43 -0000
Received: (qmail 3918 invoked by uid 97); 10 May 2002 00:48:49 -0000
Delivered-To: dcarr@example.net
Received: (qmail 3884 invoked by uid 97); 10 May 2002 00:48:48 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 3860 invoked by uid 98); 10 May 2002 00:48:47 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Message-ID: <000d01c1f7bc$5a5f9390$84992540@xptfederman>
Reply-To: "Todd Federman" <dcarr@example.net>
From: "Todd Federman" <dcarr@example.net>
To: "ORO Users List" <dcarr@example.net>
References: <dcarr@example.net>
Subject: Re: processing non-english characters 
Date: Thu, 9 May 2002 17:48:07 -0700
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Rcpt-To: <dcarr@example.net>
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

You're right. My problem on Solaris goes away if I read the text from a
database or from an HTML form. The problem only occurs when I hardcode the
string in the Java source code or a JSP file, which I won't even need to do
in my application. Thanks for the pointer.

Todd


----- Original Message -----
From: "Daniel F. Savarese" <dcarr@example.net>
To: "ORO Users List" <dcarr@example.net>
Sent: Tuesday, May 07, 2002 12:47 AM
Subject: Re: processing non-english characters



In message <001501c1f55a$2a971250$84992540@xptfederman>, "Todd Federman"
writes
:
>The code below behaves correctly in Windows XP with ORO version 2.0.6. The
...
>The same code in Solaris with 2.0.6 does perform one substitution and the

Whenever you run into a situation like this where a Java library with
no platform-dependent code or behavior produces different results for
the same program on two different platforms, the problem does not lie
in the library, but something external to it.  It looks like the problem
is happening at compilation time.  You may want to use a unicode escape
if you can't get the Java compiler on Solaris to do the right thing.  Your
problem may have something to do with your locale settings.  For what it's
worth, your program prints the same two strings for me on Linux.

daniel



--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>




--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Fri May 10 15:58:56 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 96734 invoked from network); 10 May 2002 15:58:55 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 10 May 2002 15:58:55 -0000
Received: (qmail 10328 invoked by uid 97); 10 May 2002 15:58:57 -0000
Delivered-To: dcarr@example.net
Received: (qmail 10252 invoked by uid 97); 10 May 2002 15:58:56 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 10239 invoked by uid 98); 10 May 2002 15:58:56 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Date: Fri, 10 May 2002 11:58:50 -0400 (EDT)
From: Mark Hollatz-D26 <dcarr@example.net>
Message-Id: <dcarr@example.net>
To: dcarr@example.net
Subject: backreference not working
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

In the program below I match an open XML tag and try
to use a backreference to match the corresponding
close tag, however it is not working.  The backreference
is causing it to fail.  If I replace it with "...." the
RE matches.  I am using Jakarata 2.0.6.

The backreference works in my Perl version (included below)
of this test.

Any suggestions?

Mark



import org.apache.oro.text.regex.*;
import org.apache.oro.text.perl.*;

public class OROTest {
	public static void main(String[] args)
	{
		Perl5Util perl = new Perl5Util();
		String input_data = "<B630>foo</B630>";
		String found_tag;

		System.out.println("looking...");
		if (perl.match("m|<(B6.*?)>.*</\1>|", input_data)) {
			found_tag = perl.group(1);
			System.out.println("matched tag: " + found_tag);
		}
	}
}


#!/usr/perl5/bin/perl
$input_data = "<B630>foo</B630>";
print "looking...\n";
if ($input_data =~ m|<(B6.*?)>.*</\1>|) {
	print "matched tag: $1\n";
}

--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Fri May 10 16:11:50 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 10651 invoked from network); 10 May 2002 16:11:49 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 10 May 2002 16:11:49 -0000
Received: (qmail 8445 invoked by uid 97); 10 May 2002 16:11:50 -0000
Delivered-To: dcarr@example.net
Received: (qmail 8391 invoked by uid 97); 10 May 2002 16:11:49 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 8321 invoked by uid 98); 10 May 2002 16:11:47 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
From: "Paul R Brown" <dcarr@example.net>
To: "ORO Users List" <dcarr@example.net>
Subject: RE: backreference not working
Date: Fri, 10 May 2002 11:09:56 -0500
Message-ID: <dcarr@example.net>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
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)
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
In-Reply-To: <dcarr@example.net>
Importance: Normal
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N



> Any suggestions?

Use two backslashes. :)

	-- Paul


> 		if (perl.match("m|<(B6.*?)>.*</\1>|", input_data)) {

                                           ^


--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Fri May 10 20:26:05 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 32660 invoked from network); 10 May 2002 20:26:05 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 10 May 2002 20:26:05 -0000
Received: (qmail 9416 invoked by uid 97); 10 May 2002 20:26:06 -0000
Delivered-To: dcarr@example.net
Received: (qmail 9373 invoked by uid 97); 10 May 2002 20:26:05 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 9361 invoked by uid 98); 10 May 2002 20:26:04 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3
content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Subject: Can Pattern objects be stored in a Hashtable?
Date: Fri, 10 May 2002 15:20:11 -0500
Message-ID: <dcarr@example.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Can Pattern objects be stored in a Hashtable?
Thread-Index: AcH4YK2rzzd8gCyyR++J5bRD7jmmWA==
From: "Steve Cohen" <dcarr@example.net>
To: <dcarr@example.net>
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

apparently not.  Granted, I am using a somewhat old version:

jakarta-oro-2.0.1.jar

Here is the problem, though.

I have a program that is attempting to iterate through a bunch of =
strings containing compilable patterns.  My program compiles each one =
and attempts to store it in a HashSet.  I find that the first pattern =
compiles and is stored, the second pattern compiles, but the =
HashSet.add() method that stores the pattern throws a stack overflow =
error.

java.lang.StackOverflowError
        at java.util.HashMap.access$000(HashMap.java:90)
        at java.util.HashMap$1.iterator(HashMap.java:487)
        at java.util.HashSet.iterator(HashSet.java:123)
        at java.util.AbstractSet.hashCode(AbstractSet.java:92)
        at java.util.AbstractSet.hashCode(AbstractSet.java:96)
        at java.util.AbstractSet.hashCode(AbstractSet.java:96)
        at java.util.AbstractSet.hashCode(AbstractSet.java:96)
        at java.util.AbstractSet.hashCode(AbstractSet.java:96)
etc.

Is this a bug that has been fixed in a later version?  Or is it a known =
problem?

I have looked (for the first time, I will admit) at the PatternCache, =
but it doesn't, I think, fit my needs.  Once my patterns are stored, all =
I want to do is walk through the whole bunch of them (we're not talking =
about vast numbers here, maybe 10) and try each one out looking for a =
match.

-----------------------------------------------------------------
Steve Cohen
Sr. Software Engineer
Ignite Sports, Inc.
dcarr@example.net

--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Fri May 10 21:28:24 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 75669 invoked from network); 10 May 2002 21:28:24 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 10 May 2002 21:28:24 -0000
Received: (qmail 16612 invoked by uid 97); 10 May 2002 21:28:29 -0000
Delivered-To: dcarr@example.net
Received: (qmail 16556 invoked by uid 97); 10 May 2002 21:28:28 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 16542 invoked by uid 98); 10 May 2002 21:28:27 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Message-Id: <dcarr@example.net>
X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4
To: "ORO Users List" <dcarr@example.net>
Subject: Re: Can Pattern objects be stored in a Hashtable? 
In-reply-to: Your message of "Fri, 10 May 2002 15:20:11 CDT."
             <dcarr@example.net> 
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Fri, 10 May 2002 17:28:28 -0400
From: "Daniel F. Savarese" <dcarr@example.net>
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N


In message <dcarr@example.net>, "St
eve Cohen" writes:
>apparently not.  Granted, I am using a somewhat old version:

Patterns can be stored in Hashtables and HashMaps.  This is done by the
PatternCache classes.  Whatever you're running into is peculiar to HashSet.
HashSet.hashCode() is going into an infinite loop because the
HashIterator.hasNext() is always returning true (from looking at the
stack trace and the java.util.* source code).  It looks like you
may have found a bug in Josh Bloch's collections code.  If you're using
an older JVM, I'd try a newer one and see if the problem goes away.
All indications are this is not a jakarta-oro caused problem.

daniel



--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Fri May 10 21:34:19 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 77596 invoked from network); 10 May 2002 21:34:19 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 10 May 2002 21:34:19 -0000
Received: (qmail 23265 invoked by uid 97); 10 May 2002 21:34:23 -0000
Delivered-To: dcarr@example.net
Received: (qmail 23249 invoked by uid 97); 10 May 2002 21:34:22 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 23237 invoked by uid 98); 10 May 2002 21:34:22 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3
content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Subject: RE: Can Pattern objects be stored in a Hashtable? 
Date: Fri, 10 May 2002 16:30:14 -0500
Message-ID: <dcarr@example.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Can Pattern objects be stored in a Hashtable? 
Thread-Index: AcH4aRBMLpcsvt18SZurvxXnUzLh2wAAPgCQ
From: "Steve Cohen" <dcarr@example.net>
To: "ORO Users List" <dcarr@example.net>
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

Thank you.  I had about concluded that this was the case.  I am using
jdk 1.3.1 which I suppose I should have stated in the original message.


Very interesting.  I actually solved my problem by eliminating the
HashSet (which I didn't need for patterns anyway) and replacing it with
LinkedList.

Steve

-----Original Message-----
From: Daniel F. Savarese [mailto:dcarr@example.net]
Sent: Friday, May 10, 2002 4:28 PM
To: ORO Users List
Subject: Re: Can Pattern objects be stored in a Hashtable?=20



In message
<dcarr@example.net>, "St
eve Cohen" writes:
>apparently not.  Granted, I am using a somewhat old version:

Patterns can be stored in Hashtables and HashMaps.  This is done by the
PatternCache classes.  Whatever you're running into is peculiar to
HashSet.
HashSet.hashCode() is going into an infinite loop because the
HashIterator.hasNext() is always returning true (from looking at the
stack trace and the java.util.* source code).  It looks like you
may have found a bug in Josh Bloch's collections code.  If you're using
an older JVM, I'd try a newer one and see if the problem goes away.
All indications are this is not a jakarta-oro caused problem.

daniel



--
To unsubscribe, e-mail:
<mailto:dcarr@example.net>
For additional commands, e-mail:
<mailto:dcarr@example.net>


--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Fri May 10 21:59:20 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 97677 invoked from network); 10 May 2002 21:59:20 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 10 May 2002 21:59:20 -0000
Received: (qmail 20694 invoked by uid 97); 10 May 2002 21:59:26 -0000
Delivered-To: dcarr@example.net
Received: (qmail 20642 invoked by uid 97); 10 May 2002 21:59:25 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 20625 invoked by uid 98); 10 May 2002 21:59:25 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Message-Id: <dcarr@example.net>
X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4
To: "ORO Users List" <dcarr@example.net>
Subject: Re: Can Pattern objects be stored in a Hashtable? 
In-reply-to: Your message of "Fri, 10 May 2002 16:30:14 CDT."
             <dcarr@example.net> 
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Fri, 10 May 2002 17:59:26 -0400
From: "Daniel F. Savarese" <dcarr@example.net>
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N


In message <dcarr@example.net>, "St
eve Cohen" writes:
>Very interesting.  I actually solved my problem by eliminating the
>HashSet (which I didn't need for patterns anyway) and replacing it with
>LinkedList.

I just compared the implementations of HashMap/HashSet JDK 1.3.1 vs. 1.4,
and there were a lot of changes in 1.4.  I thought I visually spotted a
bug in the 1.3.1 implementation, but I was unable to verify it with a
quick test program.  I'm curious to know exactly what the problem is, but I
think it's more like I'm looking for an excuse not to work on what I'm 
supposed to be doing right now so I'll drop it.

daniel



--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Thu May 16 18:11:03 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 11275 invoked from network); 16 May 2002 18:11:03 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 16 May 2002 18:11:03 -0000
Received: (qmail 29028 invoked by uid 97); 16 May 2002 18:11:05 -0000
Delivered-To: dcarr@example.net
Received: (qmail 28997 invoked by uid 97); 16 May 2002 18:11:04 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 10657 invoked by uid 98); 16 May 2002 17:08:02 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
To: dcarr@example.net
Subject: greedy matching of subgroups/alternatives
MIME-Version: 1.0
X-Mailer: Lotus Notes Release 5.0.8  June 18, 2001
From: dcarr@example.net
Message-ID: <dcarr@example.net>
Date: Thu, 16 May 2002 12:04:30 -0500
X-MIMETrack: Serialize by Router on Mailman/Trilogy(Release 5.0.10 |March 22, 2002) at
 05/16/2002 12:08:02 PM,
	Serialize complete at 05/16/2002 12:08:02 PM
Content-Type: multipart/alternative; boundary="=_alternative 005E114F86256BBB_="
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

--=_alternative 005E114F86256BBB_=
Content-Type: text/plain; charset="us-ascii"

Hello -

I am trying to solve the following problem:

Given a list of regular expressions and a string, find the longest 
expression that matches.

For example, I have the following properties file which defines my regular 
expressions

Explorer=10
Explorer.Sport=11
Explorer.Sport.Trac=12

So, what I do is, I create a single large regexp string as follows:
(Explorer)|(Explorer.Sport)|(Explorer.Sport.Trac)

And I create a mapping as follows:
Group 1 = 10
Group 2 = 11
Group 3 = 12

Then I compile the pattern, and call match.contains() on this pattern, 
then iterate through the groups to find the subgroup that matches. 
However, I have 
a couple of concerns about this algorithm

1) it is not very efficient, in that I have to iterate through all of the 
groups potentially when I'm really just interested in the first subgroup 
that matches
2) Unfortunately, b/c of the perl-inspired implementation, it will fail to 
correctly match the longest string.  For example, a match on
'Explorer Sport Trac' will give me a match on Explorer, *unless* I put 
'Explorer.Sport.Trac' *before* 'Explorer' in the RE.

Does anyone have any suggestions on how to solve these two problems, i.e. 
having to iterate over all of the subgroups to find the matching subgroup, 
and
having to put the REs in a certain order to guarantee the match I'm 
looking for?  Also, I don't know much about the implementation details of 
the Perl5Compiler, but is the representation I've chosen going to be 
efficient? (i.e a bunch of regexps ORed together)  There will be probably 
75-100 regular expressions all ORed together for our final implementation.

thanks for any help/advice,
Karl Brown
--=_alternative 005E114F86256BBB_=--

From oro-userdcarr@example.net Thu May 16 18:27:08 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 27794 invoked from network); 16 May 2002 18:27:08 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 16 May 2002 18:27:08 -0000
Received: (qmail 10543 invoked by uid 97); 16 May 2002 18:27:11 -0000
Delivered-To: dcarr@example.net
Received: (qmail 10527 invoked by uid 97); 16 May 2002 18:27:11 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 10515 invoked by uid 98); 16 May 2002 18:27:10 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Message-Id: <dcarr@example.net>
X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4
To: "ORO Users List" <dcarr@example.net>
Subject: Re: greedy matching of subgroups/alternatives 
In-reply-to: Your message of "Thu, 16 May 2002 12:04:30 CDT."
             <dcarr@example.net> 
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Thu, 16 May 2002 14:27:10 -0400
From: "Daniel F. Savarese" <dcarr@example.net>
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N


In message <dcarr@example.net>, Karl_Brown@tr
ilogy.com writes:
>looking for?  Also, I don't know much about the implementation details of 
>the Perl5Compiler, but is the representation I've chosen going to be 
>efficient? (i.e a bunch of regexps ORed together)  There will be probably 
>75-100 regular expressions all ORed together for our final implementation.

I can't speak to everything you've brought up right now, but I can say
that 75-100 OR'ed expressions aren't going to find matches very efficiently
with Perl5Matcher or Perl itself.  If you can live with 8-bit characters,
AwkMatcher should be significantly more efficient and it will always match
the longest possible match rather than the greedy Perl behavior.

daniel



--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Mon May 20 20:37:39 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 89803 invoked from network); 20 May 2002 20:37:39 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 20 May 2002 20:37:39 -0000
Received: (qmail 7538 invoked by uid 97); 20 May 2002 20:37:42 -0000
Delivered-To: dcarr@example.net
Received: (qmail 7497 invoked by uid 97); 20 May 2002 20:37:41 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 456 invoked by uid 98); 20 May 2002 19:03:23 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Message-ID: <dcarr@example.net>
From: Noah White <dcarr@example.net>
To: "'dcarr@example.net'" <dcarr@example.net>
Subject: oro and JDK 1.4 comparision
Date: Mon, 20 May 2002 14:58:19 -0400
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N


Has anyone done any comparisons between ORO and the regex now included with
the 1.4 JDK? Speed, features, flexibility, easy of use.

-Noah


--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Tue May 21 10:41:01 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 12010 invoked from network); 21 May 2002 10:41:00 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 21 May 2002 10:41:00 -0000
Received: (qmail 24740 invoked by uid 97); 21 May 2002 10:40:57 -0000
Delivered-To: dcarr@example.net
Received: (qmail 24683 invoked by uid 97); 21 May 2002 10:40:56 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 24631 invoked by uid 98); 21 May 2002 10:40:55 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
X-Authentication-Warning: webmail4.xs4all.nl: nobody set sender to dcarr@example.net using -f
Message-ID: <{{EMAIL+SOCIAL_SECURITY_NUMBER}}>
Date: Tue, 21 May 2002 12:40:52 +0200 (CEST)
Subject: input may not contain consecutive spaces.
From: <dcarr@example.net>
To: <dcarr@example.net>
X-Mailer: SquirrelMail (version 1.2.6 [cvs])
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

Hi,

I'm currently looking for a way to place the following constraints on
input into one single regular expression:Maximum length = 35 characters,
input must consist of AlphaNumerics and &,_, [space],(,),,[comma],.,
input may not contain consecutive spaces.

The last constraint is driving me nuts and I'm not really sure if it's
possible to implement in one single regexp.
any help would be appriciated.

regards jeroen.




--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Wed May 29 04:34:28 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 37207 invoked from network); 29 May 2002 04:34:28 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 29 May 2002 04:34:28 -0000
Received: (qmail 1605 invoked by uid 97); 29 May 2002 04:34:35 -0000
Delivered-To: dcarr@example.net
Received: (qmail 1555 invoked by uid 97); 29 May 2002 04:34:34 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 1543 invoked by uid 98); 29 May 2002 04:34:34 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
User-Agent: Microsoft-Entourage/83.161.120.1559
Date: Tue, 28 May 2002 21:35:23 -0700
Subject: Where is the Users guide?
From: Robert Nicholson <dcarr@example.net>
To: <dcarr@example.net>
Message-ID: <dcarr@example.net>
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

Is there a Users Guide or are the examples the only place to get a handle on
how to use the packages?


--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Wed May 29 05:13:05 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 47226 invoked from network); 29 May 2002 05:13:05 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 29 May 2002 05:13:05 -0000
Received: (qmail 16150 invoked by uid 97); 29 May 2002 05:13:14 -0000
Delivered-To: dcarr@example.net
Received: (qmail 16104 invoked by uid 97); 29 May 2002 05:13:13 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 16092 invoked by uid 98); 29 May 2002 05:13:13 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
User-Agent: Microsoft-Entourage/83.161.120.1559
Date: Tue, 28 May 2002 22:14:01 -0700
Subject: Re: Where is the Users guide?
From: Robert Nicholson <dcarr@example.net>
To: <dcarr@example.net>
Message-ID: <dcarr@example.net>
In-Reply-To: <dcarr@example.net>
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

To anybody interested I'm finding the following article, (admitadely old) to
be a gentle introduction explaining some of the capabilities of the package.

http://www.javaworld.com/javaworld/jw-07-2001/jw-0713-regex_p.html

On 5/28/02 9:35 PM, "Robert Nicholson" <dcarr@example.net> wrote:

> Is there a Users Guide or are the examples the only place to get a handle on
> how to use the packages?


--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Wed May 29 13:59:53 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 45417 invoked from network); 29 May 2002 13:59:52 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 29 May 2002 13:59:52 -0000
Received: (qmail 10105 invoked by uid 97); 29 May 2002 13:59:53 -0000
Delivered-To: dcarr@example.net
Received: (qmail 10031 invoked by uid 97); 29 May 2002 13:59:52 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 9967 invoked by uid 98); 29 May 2002 13:59:51 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
From: "Malcolm Davis" <dcarr@example.net>
To: "ORO Users List" <dcarr@example.net>
Subject: RE: Where is the Users guide?
Date: Wed, 29 May 2002 09:06:37 -0500
Message-ID: <dcarr@example.net>
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.2910.0)
X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
In-Reply-To: <dcarr@example.net>
Importance: Normal
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

Thanks Robert!

There most likely needs to be a list of articles
and tutorials at the ORO website.  Here is another
article by Daniel F. Savarese
http://www.devx.com/premier/mgznarch/javapro/2001/05may01/ps
0105/ps0105.asp

I have a list of urls for Perl and Awk.

- malcolm

-----Original Message-----
From: Robert Nicholson [mailto:dcarr@example.net]
Sent: Wednesday, May 29, 2002 12:14 AM
To: dcarr@example.net
Subject: Re: Where is the Users guide?


To anybody interested I'm finding the following article,
(admitadely old) to
be a gentle introduction explaining some of the capabilities
of the package.

http://www.javaworld.com/javaworld/jw-07-2001/jw-0713-regex_
p.html

On 5/28/02 9:35 PM, "Robert Nicholson" <dcarr@example.net>
wrote:

> Is there a Users Guide or are the examples the only place
to get a handle on
> how to use the packages?


--
To unsubscribe, e-mail:
<mailto:dcarr@example.net>
For additional commands, e-mail:
<mailto:dcarr@example.net>


--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Fri May 31 12:25:02 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 41851 invoked from network); 31 May 2002 12:25:02 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 31 May 2002 12:25:02 -0000
Received: (qmail 9360 invoked by uid 97); 31 May 2002 12:24:44 -0000
Delivered-To: dcarr@example.net
Received: (qmail 9323 invoked by uid 97); 31 May 2002 12:24:43 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 9311 invoked by uid 98); 31 May 2002 12:24:42 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
X-Server-Uuid: 7a42c1b6-0774-11d5-89f7-00508bcf402e
Content-return: allowed
Date: Fri, 31 May 2002 08:24:32 -0400
From: "Sharpe, Cassandra" <dcarr@example.net>
Subject: Using the Util.split() method
To: "'dcarr@example.net'" <dcarr@example.net>
Message-ID: <dcarr@example.net>
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
X-WSS-ID: 10E9B40D3510129-01-01
Content-Type: text/plain; 
 charset=iso-8859-1
Content-Transfer-Encoding: 7bit
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N


I am trying to split pipe delimited text using the Util.split() method.
However, instead of splitting the string based upon the pattern, it is
splitting the string along every character.  I included a code example
below.  When I split the pipe delimited string, I get 39 results.  When I
split the comma delimited string, I get 7 results, which is what I want.
Does anyone have any suggestions?

Thank You,
Cassandra


 import org.apache.oro.text.regex.*;
 import java.util.ArrayList;

public class TestSplit {


  private static String pipes = "E|1|1|abdomen|abdomen|abdomin|abdomin";
  private static String commas = "E,1,1,abdomen,abdomen,abdomin,abdomin";

  public TestSplit() {}

  public static void main( String[] args )throws Exception {

    ArrayList results = new ArrayList();

    Pattern commaPattern = null;
    Pattern pipePattern = null;

    PatternMatcher matcher = new Perl5Matcher();
    PatternCompiler compiler = new Perl5Compiler();


    pipePattern = compiler.compile("|");

    commaPattern = compiler.compile(",");

      Util.split(results, matcher, commaPattern, commas,  Util.SPLIT_ALL);
      System.out.println("Number with commas: " + results.size());

      results.clear();

      Util.split(results, matcher, pipePattern, pipes,  Util.SPLIT_ALL);
      System.out.println("Number with pipes: " + results.size());
  }
}



------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message.  If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.

==============================================================================


--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Fri May 31 13:07:02 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 57650 invoked from network); 31 May 2002 13:07:02 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 31 May 2002 13:07:02 -0000
Received: (qmail 16942 invoked by uid 97); 31 May 2002 13:07:01 -0000
Delivered-To: dcarr@example.net
Received: (qmail 16908 invoked by uid 97); 31 May 2002 13:07:00 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 16896 invoked by uid 98); 31 May 2002 13:06:59 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Date: Fri, 31 May 2002 09:05:15 -0400 (EDT)
From: Ed Chidester <dcarr@example.net>
X-Sender: echid@galaxy
To: ORO Users List <dcarr@example.net>
Subject: Re: Using the Util.split() method
In-Reply-To: <dcarr@example.net>
Message-ID: <Pine.GSO.3.96.1020531085935.12190A-200000@galaxy>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-851401618-1022850315=:12190"
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

---559023410-851401618-1022850315=:12190
Content-Type: TEXT/PLAIN; charset=US-ASCII



Cassandra,

The pipe is a special regular expression character. If you escape the pipe
(as I did in the attached file) you'll get the results that you expect.


   % java TestSplit
   Number with commas: 7
   Number with pipes: 39
   Number with pipes (escaped) : 7


Cheers,

Ed.

// Edward Chidester
// Software Engineer                            MNIS - Textwise Labs
// 640.763.3782                          401 South Salina Street
// dcarr@example.net                           Syracuse, NY 13202

On Fri, 31 May 2002, Sharpe, Cassandra wrote:

> 
> I am trying to split pipe delimited text using the Util.split() method.
> However, instead of splitting the string based upon the pattern, it is
> splitting the string along every character.  I included a code example
> below.  When I split the pipe delimited string, I get 39 results.  When I
> split the comma delimited string, I get 7 results, which is what I want.
> Does anyone have any suggestions?
> 
> Thank You,
> Cassandra
> 
> 
>  import org.apache.oro.text.regex.*;
>  import java.util.ArrayList;
> 
> public class TestSplit {
> 
> 
>   private static String pipes = "E|1|1|abdomen|abdomen|abdomin|abdomin";
>   private static String commas = "E,1,1,abdomen,abdomen,abdomin,abdomin";
> 
>   public TestSplit() {}
> 
>   public static void main( String[] args )throws Exception {
> 
>     ArrayList results = new ArrayList();
> 
>     Pattern commaPattern = null;
>     Pattern pipePattern = null;
> 
>     PatternMatcher matcher = new Perl5Matcher();
>     PatternCompiler compiler = new Perl5Compiler();
> 
> 
>     pipePattern = compiler.compile("|");
> 
>     commaPattern = compiler.compile(",");
> 
>       Util.split(results, matcher, commaPattern, commas,  Util.SPLIT_ALL);
>       System.out.println("Number with commas: " + results.size());
> 
>       results.clear();
> 
>       Util.split(results, matcher, pipePattern, pipes,  Util.SPLIT_ALL);
>       System.out.println("Number with pipes: " + results.size());
>   }
> }
> 
> 
> 
> ------------------------------------------------------------------------------
> Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message.  If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.
> 
> ==============================================================================
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:dcarr@example.net>
> For additional commands, e-mail: <mailto:dcarr@example.net>
> 
> 

---559023410-851401618-1022850315=:12190
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="TestSplit.java"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.3.96.1020531090515.12190B@galaxy>
Content-Description: 

LyoqDQoNCkkgYW0gdHJ5aW5nIHRvIHNwbGl0IHBpcGUgZGVsaW1pdGVkIHRl
eHQgdXNpbmcgdGhlIFV0aWwuc3BsaXQoKSBtZXRob2QuDQpIb3dldmVyLCBp
bnN0ZWFkIG9mIHNwbGl0dGluZyB0aGUgc3RyaW5nIGJhc2VkIHVwb24gdGhl
IHBhdHRlcm4sIGl0IGlzDQpzcGxpdHRpbmcgdGhlIHN0cmluZyBhbG9uZyBl
dmVyeSBjaGFyYWN0ZXIuICBJIGluY2x1ZGVkIGEgY29kZSBleGFtcGxlDQpi
ZWxvdy4gIFdoZW4gSSBzcGxpdCB0aGUgcGlwZSBkZWxpbWl0ZWQgc3RyaW5n
LCBJIGdldCAzOSByZXN1bHRzLiAgV2hlbiBJDQpzcGxpdCB0aGUgY29tbWEg
ZGVsaW1pdGVkIHN0cmluZywgSSBnZXQgNyByZXN1bHRzLCB3aGljaCBpcyB3
aGF0IEkgd2FudC4NCkRvZXMgYW55b25lIGhhdmUgYW55IHN1Z2dlc3Rpb25z
Pw0KDQpUaGFuayBZb3UsDQpDYXNzYW5kcmENCg0KDQoqKi8NCiBpbXBvcnQg
b3JnLmFwYWNoZS5vcm8udGV4dC5yZWdleC4qOw0KIGltcG9ydCBqYXZhLnV0
aWwuQXJyYXlMaXN0Ow0KDQpwdWJsaWMgY2xhc3MgVGVzdFNwbGl0IHsNCg0K
DQogIHByaXZhdGUgc3RhdGljIFN0cmluZyBwaXBlcyA9ICJFfDF8MXxhYmRv
bWVufGFiZG9tZW58YWJkb21pbnxhYmRvbWluIjsNCiAgcHJpdmF0ZSBzdGF0
aWMgU3RyaW5nIGNvbW1hcyA9ICJFLDEsMSxhYmRvbWVuLGFiZG9tZW4sYWJk
b21pbixhYmRvbWluIjsNCg0KICBwdWJsaWMgVGVzdFNwbGl0KCkge30NCg0K
ICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiggU3RyaW5nW10gYXJncyApdGhy
b3dzIEV4Y2VwdGlvbiB7DQoNCiAgICBBcnJheUxpc3QgcmVzdWx0cyA9IG5l
dyBBcnJheUxpc3QoKTsNCg0KICAgIFBhdHRlcm4gY29tbWFQYXR0ZXJuID0g
bnVsbDsNCiAgICBQYXR0ZXJuIHBpcGVQYXR0ZXJuID0gbnVsbDsNCg0KICAg
IFBhdHRlcm5NYXRjaGVyIG1hdGNoZXIgPSBuZXcgUGVybDVNYXRjaGVyKCk7
DQogICAgUGF0dGVybkNvbXBpbGVyIGNvbXBpbGVyID0gbmV3IFBlcmw1Q29t
cGlsZXIoKTsNCg0KDQogICAgcGlwZVBhdHRlcm4gPSBjb21waWxlci5jb21w
aWxlKCJ8Iik7DQoNCiAgICBjb21tYVBhdHRlcm4gPSBjb21waWxlci5jb21w
aWxlKCIsIik7DQoNCiAgICAgIFV0aWwuc3BsaXQocmVzdWx0cywgbWF0Y2hl
ciwgY29tbWFQYXR0ZXJuLCBjb21tYXMsICBVdGlsLlNQTElUX0FMTCk7DQog
ICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIk51bWJlciB3aXRoIGNvbW1hczog
IiArIHJlc3VsdHMuc2l6ZSgpKTsNCg0KICAgICAgcmVzdWx0cy5jbGVhcigp
Ow0KDQogICAgICBVdGlsLnNwbGl0KHJlc3VsdHMsIG1hdGNoZXIsIHBpcGVQ
YXR0ZXJuLCBwaXBlcywgIFV0aWwuU1BMSVRfQUxMKTsNCiAgICAgIFN5c3Rl
bS5vdXQucHJpbnRsbigiTnVtYmVyIHdpdGggcGlwZXM6ICIgKyByZXN1bHRz
LnNpemUoKSk7DQoNCiAgICAgIHJlc3VsdHMuY2xlYXIoICk7DQogICAgICBw
aXBlUGF0dGVybiA9IGNvbXBpbGVyLmNvbXBpbGUoICJcXHwiICk7DQogICAg
ICBVdGlsLnNwbGl0KHJlc3VsdHMsIG1hdGNoZXIsIHBpcGVQYXR0ZXJuLCBw
aXBlcywgIFV0aWwuU1BMSVRfQUxMKTsNCiAgICAgIFN5c3RlbS5vdXQucHJp
bnRsbigiTnVtYmVyIHdpdGggcGlwZXMgKGVzY2FwZWQpIDogIiArIHJlc3Vs
dHMuc2l6ZSgpKTsNCiAgfQ0KfQ0KDQoNCi8qKg0KLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tDQpOb3RpY2U6ICBUaGlzIGUtbWFpbCBtZXNz
YWdlLCB0b2dldGhlciB3aXRoIGFueSBhdHRhY2htZW50cywgY29udGFpbnMg
aW5mb3JtYXRpb24gb2YgTWVyY2sgJiBDby4sIEluYy4gKFdoaXRlaG91c2Ug
U3RhdGlvbiwgTmV3IEplcnNleSwgVVNBKSB0aGF0IG1heSBiZSBjb25maWRl
bnRpYWwsIHByb3ByaWV0YXJ5IGNvcHlyaWdodGVkIGFuZC9vciBsZWdhbGx5
IHByaXZpbGVnZWQsIGFuZCBpcyBpbnRlbmRlZCBzb2xlbHkgZm9yIHRoZSB1
c2Ugb2YgdGhlIGluZGl2aWR1YWwgb3IgZW50aXR5IG5hbWVkIGluIHRoaXMg
bWVzc2FnZS4gIElmIHlvdSBhcmUgbm90IHRoZSBpbnRlbmRlZCByZWNpcGll
bnQsIGFuZCBoYXZlIHJlY2VpdmVkIHRoaXMgbWVzc2FnZSBpbiBlcnJvciwg
cGxlYXNlIGltbWVkaWF0ZWx5IHJldHVybiB0aGlzIGJ5IGUtbWFpbCBhbmQg
dGhlbiBkZWxldGUgaXQuDQoNCj09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PQ0KDQoNCi0tDQpUbyB1bnN1YnNjcmliZSwgZS1tYWlsOiAgIDxt
YWlsdG86b3JvLXVzZXItdW5zdWJzY3JpYmVAamFrYXJ0YS5hcGFjaGUub3Jn
Pg0KRm9yIGFkZGl0aW9uYWwgY29tbWFuZHMsIGUtbWFpbDogPG1haWx0bzpv
cm8tdXNlci1oZWxwQGpha2FydGEuYXBhY2hlLm9yZz4NCioqLw0KDQoNCg==

---559023410-851401618-1022850315=:12190
Content-Type: text/plain; charset=us-ascii

--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>
---559023410-851401618-1022850315=:12190--

From oro-userdcarr@example.net Fri May 31 14:40:27 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 18670 invoked from network); 31 May 2002 14:40:27 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 31 May 2002 14:40:27 -0000
Received: (qmail 9019 invoked by uid 97); 31 May 2002 14:40:26 -0000
Delivered-To: dcarr@example.net
Received: (qmail 8979 invoked by uid 97); 31 May 2002 14:40:26 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 8967 invoked by uid 98); 31 May 2002 14:40:25 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
X-Originating-IP: [83.161.120.155]
From: "Adrian Boyko" <dcarr@example.net>
To: <dcarr@example.net>
Subject: Subgroup wrong when matching (.)(?=(.)) against "XY"?
Date: Fri, 31 May 2002 07:40:20 -0700
MIME-Version: 1.0
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <dcarr@example.net>
X-OriginalArrivalTime: 31 May 2002 14:40:21.0213 (UTC) FILETIME=[174078D0:01C208B1]
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

The following case behaves as I would expect:
   Perl5 Expression: (.)(?=(.))(.)
   Search Input: XYZ
   Match 1: XY
      Subgroups:
         1: X
         2: Y
         3: Y

But the slightly simpler case, below, doesn't seem to match the 2nd subgroup
correctly:
   Perl5 Expression: (.)(?=(.))
   Search Input: XY
   Match 1: X
      Subgroups:
         1: X
         2:

Shouldn't the second subgroup in the second case be "Y" instead of blank?
I'm trying this in the "Demonstration Applet" from version 2.0.6.

Adrian

--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Fri May 31 16:02:35 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 99067 invoked from network); 31 May 2002 16:02:35 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 31 May 2002 16:02:35 -0000
Received: (qmail 26370 invoked by uid 97); 31 May 2002 16:02:35 -0000
Delivered-To: dcarr@example.net
Received: (qmail 26338 invoked by uid 97); 31 May 2002 16:02:34 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 26326 invoked by uid 98); 31 May 2002 16:02:34 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Message-Id: <dcarr@example.net>
X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4
To: "ORO Users List" <dcarr@example.net>
Subject: Re: Subgroup wrong when matching (.)(?=(.)) against "XY"? 
In-reply-to: Your message of "Fri, 31 May 2002 07:40:20 PDT."
             <dcarr@example.net> 
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Fri, 31 May 2002 12:02:31 -0400
From: "Daniel F. Savarese" <dcarr@example.net>
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N


In message <dcarr@example.net>, "Adrian Boyko" writes:
>But the slightly simpler case, below, doesn't seem to match the 2nd subgroup
>correctly:
>   Perl5 Expression: (.)(?=(.))
>   Search Input: XY
>   Match 1: X
>      Subgroups:
>         1: X
>         2:
>
>Shouldn't the second subgroup in the second case be "Y" instead of blank?

Perl does fill $2 with Y.  And so does Perl5Matcher.  If you look at
the group offsets, you'll find the matching is performed correctly.  In
other words, two groups are found and the begin and end offsets of the
second group are 1 and 2.  However, because the matched group was a
zero-width lookahead assertion, the Y character it is not consumed and
considered part of the full match.  So the full match is just 'X'.  Since
the full match stored in the MatchResult is 'X', offsets that exceed the
length of the match result in empty strings.  To show that the full
match is just 'X' in Perl, look at group 0 here:

~> perl -e '"xy" =~ /(.)(?=(.))/; print "0: $& 1: $1 2: $2 3: $3\n";'
0: x 1: x 2: y 3: 

Now, the problem we're faced with is one that I'm not sure how to deal
with.  Is the capturing of the lookahead assertion an undefined
side-effect, much as some situations involving the capturing of
repetitions used to be before Perl 5.6?  Or is it intended for a
groups that match outside of the full match to be saved?  It's
actually quite tricky to implement this without either maintaining
a reference to a copy of the entire original input (undesirable) or
screwing up a lot of other cases.  I'd like to mull this one over
for a while.  In the meantime, the workaround is to use the group
offset information to extract the appropriate substring from the
input.

daniel



--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>


From oro-userdcarr@example.net Fri May 31 16:36:10 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 34009 invoked from network); 31 May 2002 16:36:10 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 31 May 2002 16:36:10 -0000
Received: (qmail 9594 invoked by uid 97); 31 May 2002 16:36:10 -0000
Delivered-To: dcarr@example.net
Received: (qmail 9561 invoked by uid 97); 31 May 2002 16:36:09 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 9523 invoked by uid 98); 31 May 2002 16:36:08 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Message-ID: <6757931EA0D9D3118B8E00C04FA05FB08A6369@pansvr02>
From: Arvind Gudipati <dcarr@example.net>
To: ORO Users List <dcarr@example.net>
Subject: simple regex
Date: Fri, 31 May 2002 12:36:07 -0400
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2655.55)
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C208C1.43BF5C40"
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

------_=_NextPart_001_01C208C1.43BF5C40
Content-Type: text/plain;
	charset="iso-8859-1"

This should be a simple question.

How do i check if a particular single DOESNOT contains a word?

for example:
String string1 = "one, two ABC end";
String string2 = "two, four abcd end";

and letz say i only want stirng's which doesnt contain "ABC" (note:
case-senitive).. what would be the regex for the same?

Many thnx in advance:)



























****************************************************************************
*************                                 This E-mail is from PANACYA
Inc. The E-mail and any files transmitted with it are confidential and may
also be privileged and intended solely for the use of the individual or
entity to whom they are addressed. Any unauthorized direct or indirect
dissemination, distribution or copying of this message and any attachments
is strictly prohibited. If you have received the E-mail in error please
notify dcarr@example.net or telephone 640.763.3782.
****************************************************************************
************

------_=_NextPart_001_01C208C1.43BF5C40--

From oro-userdcarr@example.net Fri May 31 16:36:27 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 35095 invoked from network); 31 May 2002 16:36:27 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 31 May 2002 16:36:27 -0000
Received: (qmail 9922 invoked by uid 97); 31 May 2002 16:36:27 -0000
Delivered-To: dcarr@example.net
Received: (qmail 9859 invoked by uid 97); 31 May 2002 16:36:26 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 9847 invoked by uid 98); 31 May 2002 16:36:26 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Message-Id: <dcarr@example.net>
X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4
To: "ORO Users List" <dcarr@example.net>
Subject: Re: Subgroup wrong when matching (.)(?=(.)) against "XY"? 
In-reply-to: Your message of "Fri, 31 May 2002 12:02:31 EDT."
             <dcarr@example.net> 
Mime-Version: 1.0
Content-Type: multipart/mixed ;
	boundary="==_Exmh_-640.763.3782"
Date: Fri, 31 May 2002 12:36:24 -0400
From: "Daniel F. Savarese" <dcarr@example.net>
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

--==_Exmh_-640.763.3782
Content-Type: text/plain; charset=us-ascii


In message <dcarr@example.net>, "Daniel F. Savarese" 
writes:
>groups that match outside of the full match to be saved?  It's
>actually quite tricky to implement this without either maintaining
>a reference to a copy of the entire original input (undesirable) or
>screwing up a lot of other cases.  I'd like to mull this one over

Here's a patch that fixes the case you reported.  I don't think it
breaks anything else, but I can't be sure.  Any volunteers for those
unit tests we keep talking about?  At any rate, I don't want to apply
the patch until it has been well-tested.

daniel



--==_Exmh_-640.763.3782
Content-Type: text/plain ; name="LookaheadAssertionGroup.patch.txt"; charset=us-ascii
Content-Description: LookaheadAssertionGroup.patch.txt
Content-Disposition: attachment; filename="LookaheadAssertionGroup.patch.txt"

Index: src/java/org/apache/oro/text/regex/Perl5MatchResult.java
===================================================================
RCS file: /home/cvs/jakarta-oro/src/java/org/apache/oro/text/regex/Perl5MatchResult.java,v
retrieving revision 1.4
diff -u -r1.4 Perl5MatchResult.java
--- src/java/org/apache/oro/text/regex/Perl5MatchResult.java	17 May 2001 21:59:33 -0000	1.4
+++ src/java/org/apache/oro/text/regex/Perl5MatchResult.java	31 May 2002 16:21:15 -0000
@@ -125,7 +125,11 @@
    * @return The length of the match.
    */
   public int length(){
-    return _match.length();
+    int length;
+
+    length = (_endGroupOffset[0] - _beginGroupOffset[0]);
+
+    return (length > 0 ? length : 0);
   }
 
 
Index: src/java/org/apache/oro/text/regex/Perl5Matcher.java
===================================================================
RCS file: /home/cvs/jakarta-oro/src/java/org/apache/oro/text/regex/Perl5Matcher.java,v
retrieving revision 1.18
diff -u -r1.18 Perl5Matcher.java
--- src/java/org/apache/oro/text/regex/Perl5Matcher.java	25 Jan 2002 09:32:28 -0000	1.18
+++ src/java/org/apache/oro/text/regex/Perl5Matcher.java	31 May 2002 16:21:16 -0000
@@ -241,7 +241,7 @@
   // Set the match result information.  Only call this if we successfully
   // matched.
   private void __setLastMatchResult() {
-    int offs;
+    int offs, maxEndOffs = 0;
 
     //endOffset+=dontTry;
 
@@ -251,10 +251,6 @@
     if(__endMatchOffsets[0] > __originalInput.length)
       throw new ArrayIndexOutOfBoundsException();
 
-    __lastMatchResult._match =
-      new String(__originalInput, __beginMatchOffsets[0],
-		 __endMatchOffsets[0] - __beginMatchOffsets[0]);
-
     __lastMatchResult._matchBeginOffset = __beginMatchOffsets[0];
 
     while(__numParentheses >= 0) {
@@ -269,15 +265,21 @@
 
       offs = __endMatchOffsets[__numParentheses];
 
-      if(offs >= 0)
+      if(offs >= 0) {
 	__lastMatchResult._endGroupOffset[__numParentheses] =
 	  offs - __lastMatchResult._matchBeginOffset;
-      else
+	if(offs > maxEndOffs && offs <= __originalInput.length)
+	  maxEndOffs = offs;
+      } else
 	__lastMatchResult._endGroupOffset[__numParentheses] =
 	  OpCode._NULL_OFFSET;
 
       --__numParentheses;
     }
+
+    __lastMatchResult._match =
+      new String(__originalInput, __beginMatchOffsets[0],
+		 maxEndOffs - __beginMatchOffsets[0]);
 
     // Free up for garbage collection
     __originalInput = null;


--==_Exmh_-640.763.3782
Content-Type: text/plain; charset=us-ascii

--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>
--==_Exmh_-640.763.3782--



From oro-userdcarr@example.net Fri May 31 16:38:43 2002
Return-Path: <oro-userdcarr@example.net>
Delivered-To: dcarr@example.net
Received: (qmail 36697 invoked from network); 31 May 2002 16:38:43 -0000
Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155)
  by daedalus.apache.org with SMTP; 31 May 2002 16:38:43 -0000
Received: (qmail 13143 invoked by uid 97); 31 May 2002 16:38:37 -0000
Delivered-To: dcarr@example.net
Received: (qmail 13055 invoked by uid 97); 31 May 2002 16:38:36 -0000
Mailing-List: contact dcarr@example.net; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:dcarr@example.net>
List-Subscribe: <mailto:dcarr@example.net>
List-Help: <mailto:dcarr@example.net>
List-Post: <mailto:dcarr@example.net>
List-Id: "ORO Users List" <oro-user.jakarta.apache.org>
Reply-To: "ORO Users List" <dcarr@example.net>
Delivered-To: mailing list dcarr@example.net
Received: (qmail 12997 invoked by uid 98); 31 May 2002 16:38:36 -0000
X-Antivirus: nagoya (v4198 created Apr 24 2002)
Message-Id: <dcarr@example.net>
X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4
To: "ORO Users List" <dcarr@example.net>
Subject: Re: Subgroup wrong when matching (.)(?=(.)) against "XY"? 
In-reply-to: Your message of "Fri, 31 May 2002 07:40:20 PDT."
             <dcarr@example.net> 
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Fri, 31 May 2002 12:38:33 -0400
From: "Daniel F. Savarese" <dcarr@example.net>
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N


In message <dcarr@example.net>, "Adrian Boyko" writes:
>The following case behaves as I would expect:

Actually, Adrian, can you file a Bugzilla bug report?  I'll add the
information in the follow up emails I've sent.  This way it won't be
forgotten and we'll have a better (virtual) paper trail.

thanks,
daniel





--
To unsubscribe, e-mail:   <mailto:dcarr@example.net>
For additional commands, e-mail: <mailto:dcarr@example.net>



{'source': 'Apache Software Foundation Public Mail Archives'}