You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-user@jakarta.apache.org by jeff <jl...@houseofdistraction.com> on 2000/09/13 03:03:55 UTC

Perl5Matcher ignores BeginOffset???

I think there is a bug in Perl5Matcher.  I expected that the BeginOffset
property of Perl5MatcherInput would affect the behavior of the '^'
character in a pattern but it doesn't.  Example

PatternCompiler compiler = new Perl5Compiler();
Pattern pattern = compiler.compile( "^a" );
Perl5MatcherInput input = new Perl5MatcherInput( "aaa" );
PatternMatcher matcher = new Perl5Matcher();
boolean test;

// this works as expected (test gets the value 'true')
test = matcher.contains( input, pattern );

// this doesn't work as expected (test gets the value 'false')
input.setCurrentOffset(1);
input.setBeginOffset(1);
test = matcher.contains( input, pattern );


Is this actually a bug or is there some other use for the BeginOffset
property?