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 bu...@apache.org on 2004/01/09 05:15:22 UTC

DO NOT REPLY [Bug 25985] - In MATCH_MULTILINE-mode $ does not match end of line

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25985

In MATCH_MULTILINE-mode $ does not match end of line





------- Additional Comments From son@sparc.spb.su  2004-01-09 04:15 -------
I think that match() doesn't work due to bug #4137.
I've verified that the problem is gone when suggested fix for 4137 applied.

But after this I get exception in subst()
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String ind
ex out of range: -1
        at java.lang.String.substring(String.java:1480)
        at org.apache.regexp.RE.subst(RE.java:1784)
        at Bug25985.main(Bug25985.java:9)
It occured because we specify RE.REPLACE_BACKREFERENCES flag for subst(), but 
substitution parameter dosn't contain any such references.  Thus we try to 
execute the following line:
                // Append everything after the last $ sign
                ret.append(substitution.substring(lLastPosition+2,lLength));
when lLength == 1 and lLastPosition == 0 (so, start position more then end one)
To fix this problem we can just change default value of lLastPosition to -2
(so if there is no $ in substitution param we will add substitution itself)

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