jakarta-oro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34536] New: - Perl5Util fall into endless loop
Date Wed, 20 Apr 2005 00:47:26 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34536>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34536

           Summary: Perl5Util fall into endless loop
           Product: ORO
           Version: 2.0.8
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
        AssignedTo: oro-dev@jakarta.apache.org
        ReportedBy: yamamoto@karl.tis.co.jp


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");
  }

 }
}
---------------------------

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message