When I write a complicated regular expression on Perl5Util, sometimes there is no response. In other threads, there was similar answer which said " the way of regular expression is not good" but as far as regular expression library of JDK is response correctly, it may say that this is bag of ORO. So complicated regular expression takes time that it may not use for enterprise. Also if I could not get the response on given period, do I have the way to get "Time out"? --------------------------------------------------------------------------- 1.HTML is downloaded by way of HTTP. 2.The regular expression is tested by using the regular expression library of JDK. ->Response correctly 3.The regular expression is tested by using ORO. ->No response. import org.apache.commons.httpclient.HostConfiguration; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.oro.text.perl.Perl5Util; public class FreezeSample { public static void main(String[] args) throws Exception{ HostConfiguration config = new HostConfiguration(); config.setProxy("myproxy",8080); String p = "/.*?<TABLE.*?<TABLE.*?<TR>.*?<TR>.*?<TD.*?<TD.*?<B>\\[.*?Km(.*?)\\]</B>/is" ; String srcSite = "http://jakarta.apache.org/oro/"; HttpClient client = new HttpClient(); client.setHostConfiguration(config); GetMethod m = new GetMethod(srcSite); client.executeMethod(m); String src = m.getResponseBodyAsString(); System.out.println("pattern:" + p); System.out.println("src:" + src); //Test JDK Regexp System.out.println("javareg:" + src.matches(p)); //Test ORO Regexp Perl5Util perl = new Perl5Util(); if (perl.match(p, src)) { System.out.println("Match Ok"); System.out.println(perl.getMatch()); } else { System.out.println("Match NG"); } } } ---------------------------
*** This bug has been marked as a duplicate of 34309 ***