You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-dev@jakarta.apache.org by Kurt Westerfeld <ku...@ManagedObjects.com> on 2000/06/20 16:37:10 UTC

RE diffs for case-insenstive bug

If I create a regular expression using the expression "foo" with case
independence turned on, the RE class will not match "Foo", nor will it match
"the Foo".

The problem seems to be related to some "prefix optimization" code I found.
If a prefix match is to be performed, the code does not match the prefix
when the case independent flag is on.

Here's a patch. for this

1490a1491
>             boolean caseIndependent = (matchFlags & MATCH_CASEINDEPENDENT)
!= 0;
1494c1495,1500
<                 if (search.charAt(i) == prefix[0])
---
>                 boolean match = false;
>                 if (caseIndependent)
>                     match = Character.toLowerCase(search.charAt(i)) ==
Character.toLowerCase(prefix[0]);
>                 else
>                     match = search.charAt(i) == prefix[0];
>                 if (match)
1502c1508,1512
<                         if (search.charAt(i++) != prefix[k++])
---
>                         if (caseIndependent)
>                             match =
Character.toLowerCase(search.charAt(i++)) ==
Character.toLowerCase(prefix[k++]);
>                         else
>                             match = search.charAt(i++) == prefix[k++];
>                         if (!match)


________________________________________________________________________
  Kurt Westerfeld
  Managed Objects Incorporated
  7925 Westpark Drive
  McLean, VA  22102
  Phone: 703.770.7225
  Fax: 703.208.3331
  http://www.ManagedObjects.com
  mailto:kwester@ManagedObjects.com



Re: RE diffs for case-insenstive bug

Posted by Jon Stevens <jo...@latchkey.com>.
on 6/22/2000 1:52 PM, "Kurt Westerfeld" <ku...@ManagedObjects.com> wrote:

> Are announcements about new releases posted to this list?

of course.

-jon


Re: RE diffs for case-insenstive bug

Posted by Kurt Westerfeld <ku...@ManagedObjects.com>.
Are announcements about new releases posted to this list?

Sorry if this is obvious!

----- Original Message -----
From: Jon Stevens <jo...@latchkey.com>
To: <re...@jakarta.apache.org>
Sent: Thursday, June 22, 2000 4:45 PM
Subject: Re: RE diffs for case-insenstive bug


> on 6/20/2000 7:37 AM, "Kurt Westerfeld" <ku...@ManagedObjects.com> wrote:
>
> > If I create a regular expression using the expression "foo" with case
> > independence turned on, the RE class will not match "Foo", nor will it
match
> > "the Foo".
> >
> > The problem seems to be related to some "prefix optimization" code I
found.
> > If a prefix match is to be performed, the code does not match the prefix
> > when the case independent flag is on.
>
> ok, i apologize for not getting this in earlier. it is now in CVS. i plan
on
> doing a release soon.
>
> -jon


Re: RE diffs for case-insenstive bug

Posted by Jon Stevens <jo...@latchkey.com>.
on 6/20/2000 7:37 AM, "Kurt Westerfeld" <ku...@ManagedObjects.com> wrote:

> If I create a regular expression using the expression "foo" with case
> independence turned on, the RE class will not match "Foo", nor will it match
> "the Foo".
> 
> The problem seems to be related to some "prefix optimization" code I found.
> If a prefix match is to be performed, the code does not match the prefix
> when the case independent flag is on.

ok, i apologize for not getting this in earlier. it is now in CVS. i plan on
doing a release soon.

-jon