jakarta-oro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel F. Savarese" <...@savarese.org>
Subject Re: Possible bug with Perl5Matcher and PatternMatcherInput
Date Fri, 31 Aug 2001 20:32:13 GMT

In message <095F1C2C73A3F84485C5838D4AC480D212D3AE@discovery.datacrit.com>, Jef
f McNiel writes:
>This can be reproduced by changing the file:
>     jakarta-oro-2.0.4/src/java/examples/prefixExample.java
>to use contains() instead of matchesPrefix() in the "first" approach.

matchesPrefix() does not advance the current offset.  contains() does.
With contains(), every subsequent match picks up from where the last
successful match left off regardless of what pattern you are using.
If you want to start from the beginning again, you have to reset the
PatternMatcherInput current offset to the beginning.  So prefixExample.java
will behave completely differently when matchesPrefix() is changed to

>There seems to have been a relativly big change between 2.0 
>and 2.0.4 in re the __initInterpreterGlobals business and the 
>use of [__]currentOffset vs. [__]beginOffset - I suspect something 

There shouldn't be anything wrong there.  The changes after 2.0 fix
a problem with anchors (see the CHANGES file).  If you find anything
else that you think is a problem, post some sample code and input
reproducing the problem and we'll have at it.  At this stage
(maintenance mode), almost all problems tend to be misunderstandings
because of lack of better examples and a user's guide.  But we'll fix
that soon enough and start breaking things once the Perl 5.6
compatibility effort begins in earnest and we enter development mode


View raw message