You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-user@jakarta.apache.org by Ralph Schaer <rs...@datacomm.ch> on 2001/02/04 07:10:23 UTC
Pattern does not work
Hi
I'm comparing gnu regex, jakarta regex and oro. Now I have the problem that
my test pattern does not
work with jakarta regexp 1.2
Here my test program. gnu and oro match the pattern with the string, but
jakarta regex does not.
Any ideas?
Ralph
String s = "POST http://localhost/planner/test/hh.html?kdjf=jdfkj&kj=j
HTTP/1.0";
org.apache.regexp.RE regexp = new
org.apache.regexp.RE("^(GET|HEAD|POST|PUT|DELETE|LINK|UNLINK)
[\\w]+://\\w+:{0,1}\\d*([^ ]+) ([\\w/.]+)$");
if ( regexp.match(s) ) {
System.out.println(regexp.getParen(1));
System.out.println(regexp.getParen(2));
System.out.println(regexp.getParen(3));
} else {
System.out.println("no match");
}