DO NOT REPLY [Bug 23132] New: - Perl5Util.match() hangs/loops in certain cases
[email protected] 12 Sep 2003 09:57:45 -0000
| Newsgroups | gmane.comp.jakarta.oro.devel |
|---|---|
| Message-ID | <[email protected]> |
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=23132>.
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=23132
Perl5Util.match() hangs/loops in certain cases
Summary: Perl5Util.match() hangs/loops in certain cases
Product: ORO
Version: 2.0.7
Platform: PC
OS/Version: Windows NT/2K
Status: NEW
Severity: Major
Priority: Other
Component: Main
AssignedTo: [email protected]
ReportedBy: [email protected]
Hi!
I use Perl5Util.match() to validate email addresses. For .co.uk addresses that
lack an @, using the regular expression pattern, "^(\\w+[-_.'&\\/]*)+@(\\w+[-
_.])+\\w+$", the call to match() takes about 20 mins to return on a quad CPU
server (during which time the CPUs are very busy).
Here is some demonstration code. I experience this problem on version 2.0.6 and
2.0.7
Many thanks,
Louis Joubert
-------------------
import org.apache.oro.text.perl.Perl5Util;
public class TestPerlMatcher{
public static void main (String[] args){
Perl5Util _perlUtil = new Perl5Util();
String validationRE = "^(\\w+[-_.'&\\/]*)+@(\\w+[-_.])+\\w+$";
String[] addresses =
{"[email protected]", "joe.bloggsblogger.com", "[email protected]",
"joe.bloggsblogger.co.uk", "craig.rendowe@kopekope
mopers.co.uk", "craig.rendowekopekopemopers.co.uk"}; //only the latter fails
for (int i=0; i<addresses.length; i++){
System.out.println("PerlMatcher returns, for email
address "+addresses[i]+", "+_perlUtil.match("/" + validationRE + "/", addresses
[i]));
}
}
}