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 2003/10/01 03:30:33 UTC
DO NOT REPLY [Bug 23476] -
RE.match(string, RE.MATCH_MULTILINE) does not match first 2 chars
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=23476>.
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=23476
RE.match(string, RE.MATCH_MULTILINE) does not match first 2 chars
------- Additional Comments From son@sparc.spb.su 2003-10-01 01:30 -------
I think there is a bug in the test:
it uses RE.match(String, int) method, but int param in this method is an
opffset for matchin not a match flag.
To multiline match regexp the test should set match flag using setMatchFlag().
The correct test will be :
String resrc="Location: ";
String data="Location: /cookie-check?";
RE re = new RE(reSrc);
re.setMatchFlags(RE.MATCH_MULTILINE);
if(!re.match(data)) { // returns false !!!
}
---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-dev-help@jakarta.apache.org