You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-dev@jakarta.apache.org by I Lee Hetherington <il...@sls.lcs.mit.edu> on 2000/10/30 22:03:59 UTC

Perl5Util problem with m/.../m

I am having a problem with multi-line matching.  The following worked
returned true in PerlTools 1.2, but not with the 2.0 version.

         static boolean test() {
             String input = "abcdef\ndef\n";
             Perl5Util perl = new Perl5Util();
             return perl.match("m/^def/m", input);
         }

The "m" at the end, indicating multi-line, doesn't seem to have any
effect.  A similar construct in Perl 5.005003 works fine, as does the
PerlTools 1.2 code.

Am I doing something wrong or is "m" broken?

--Lee Hetherington





Re: Perl5Util problem with m/.../m

Posted by I Lee Hetherington <il...@sls.lcs.mit.edu>.
I have tracked things down into Perl5Matcher a bit.  __multiline does
not get set even though pattern.getOptions() has
Perl5Compiler.MULTILINE_MASK set.  If I set __multiline if this bit is
set, then it works as expected.  However, this is a crude hack and
disturbs the explicit setting of setMultiline().  I do believe there is
a bug in the handling of multi-line matches.

--Lee Hetherington