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 "Daniel F. Savarese" <df...@savarese.org> on 2003/05/15 16:56:31 UTC

Re: is "\S+\s*$" with MULTILINE_MASK broken?

In message <3E...@localhost>, "Anders Cederlund" writes:
>"\S+\s*$" and "\S+ *$" does not match the same string.
...
>So... bug, feature?

Not sure.  Correct results are:

~> perl -e '$input = " aaa bbb \n ccc ddd \n eee fff "; @matches = ($input =~ m/\S+ *$/gm); for my $match (@matches) { print "|$match|\n"; }'
|bbb |
|ddd |
|fff |

~> perl -e '$input = " aaa bbb \n ccc ddd \n eee fff "; @matches = ($input =~ m/\S+\s*$/gm); for my $match (@matches) { print "|$match|\n"; }'
|bbb |
|ddd |
|fff |

My test reusults with MULTILINE_MASK are:

\S+\s*$:

|fff |

\S+ *$:

|bbb |
|ddd |
|fff |

But with Perl5Matcher.setMultiline(true), they are:

\S+\s*$:

|bbb |
|ddd |
|fff |

\S+ *$:

|bbb |
|ddd |
|fff |

For now use setMultiline(true) if you can.  I can't say for sure if
this is a regression, a lurking bug, or an intended distinction between
compiling with MULTILINE_MASK and setMultiline(true).  (I doubt
it's an intended distinction).  I'll look at it over the weekend because
the source of the discrepancy is not immediately obvious to me.  If
you can, open a bugzilla report to track the problem.  After resolving
this I'd like to vote on a 2.0.8 maintenance release since we've got
another fix that's been sitting in CVS for a while.

daniel



---------------------------------------------------------------------
To unsubscribe, e-mail: oro-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: oro-dev-help@jakarta.apache.org


Re: is "\S+\s*$" with MULTILINE_MASK broken?

Posted by Anders Cederlund <an...@biglandscape.com>.
On 15 May 2003 at 10:56, Daniel F. Savarese wrote:

//
> For now use setMultiline(true) if you can.  I can't say for sure if
//
>My brain wouldn't let me put it off until the weekend.  I tracked down
>the problem and fixed it.  Check out the latest CVS source to verify.
//

Thanks. It's a privilege to be on the receiving end of such fast 
responses with workarounds and fixes.

/Anders C

---------------------------------------------------------------------
To unsubscribe, e-mail: oro-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: oro-dev-help@jakarta.apache.org