Re: Most efficient character parsing.
Re: Most efficient character parsing.
- Subject: Re: Most efficient character parsing.
- From: Arturo Perez <email@hidden>
- Date: Thu, 16 Feb 2006 09:58:38 -0500
Jerry W. Walker wrote:
Hi, Chuck & Eric,
Sorry, Chuck, I parsed it.
Interesting approach.
Eric,
You might try timing the following:
String regExp = "[\x09\x0A\x0D\x20-\x7E\xA0-\xFF]*";
Pattern p = Pattern.compile(regExp);
Loop through strings:
String result = p.matcher(yourString).replaceAll("");
I didn't debug that and always get confused on double escaping, so you
might need to replace the "\x" sequences to "\\x".
Regards,
Jerry
The Java Regexp stuff is easy to outperform. In my tests, doing
character by character stuff versus a regexp was about 10x
faster if what you're doing can be done that way. This was using Sun's
VM on Linux. But maybe the guy that did the regexp
forgot to precompile...
-arturo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden