Re: Most efficient character parsing.
Re: Most efficient character parsing.
- Subject: Re: Most efficient character parsing.
- From: "Jerry W. Walker" <email@hidden>
- Date: Thu, 16 Feb 2006 09:36:02 -0500
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
On Feb 16, 2006, at 7:47 AM, Jerry W. Walker wrote:
Hi, Chuck,
I'm having trouble parsing this last messagel. Can you explain?
Thanks,
Jerry
On Feb 15, 2006, at 6:22 PM, Chuck Hill wrote:
And use any array of int (or boolean?) pre-populated with 1/0 at
the index of the relevant character so you can do:
if (allowable[bees[i]]) /*add character */
instead of multiple if comparisons.
And run tests to see if this is really faster.
Chuck
On Feb 15, 2006, at 2:40 PM, Arturo Pérez wrote:
Not really a WO question but here's what I'd do.
byte [] bees = s.toBytes();
for (int i = 0; ....)
I've done that in the past with great success.
-arturo
On Feb 15, 2006, at 4:43 PM, Eric Stewart wrote:
I've got a WOApp that needs to deal with 200 strings of
approximately
250-500 characters per string.
I need to strip out all characters that are not ISO-8859-1 legal
characters. So basically any character that is not decimal ascii
character 9, 10, 13, 32-126, 160-255 need to be removed from the
string. This process is happening roughly 2.5 million times a
day and
I'm trying to figure out what is the most efficient way to do it.
Right now I'm tearing the strings apart character-by-character and
checking it's ascii decimal value against the values I know are
good.
Is there a more efficient way to do it?
Thanks everyone,
- Eric
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40ethicist.net
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Coming in 2006 - an introduction to web applications using
WebObjects and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve
specific problems. http://www.global-village.net/products/
practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial
Strength Internet Enabled Systems
email@hidden
203 278-4085 office
--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial
Strength Internet Enabled Systems
email@hidden
203 278-4085 office
--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial
Strength Internet Enabled Systems
email@hidden
203 278-4085 office
_______________________________________________
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