• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Most efficient character parsing.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Most efficient character parsing. (From: Eric Stewart <email@hidden>)
 >Re: Most efficient character parsing. (From: Arturo PĂ©rez <email@hidden>)
 >Re: Most efficient character parsing. (From: Chuck Hill <email@hidden>)
 >Re: Most efficient character parsing. (From: "Jerry W. Walker" <email@hidden>)
 >Re: Most efficient character parsing. (From: "Jerry W. Walker" <email@hidden>)

  • Prev by Date: Re: Unique attributes
  • Next by Date: Re: Custom Class Problems
  • Previous by thread: Re: Most efficient character parsing.
  • Next by thread: Re: Most efficient character parsing.
  • Index(es):
    • Date
    • Thread