[Israel.pm] 8-bit characters recognition
Roman M. Parparov
romm at empire.tau.ac.il
Wed May 19 05:29:49 PDT 2004
On Wed, May 19, 2004 at 03:23:53PM +0300, Omer Zak wrote:
>
> On Wed, 19 May 2004, Roman M. Parparov wrote:
>
> > What would be a simple way to recognize if an 8-bit (ord($c) > 0x7f)
> > character is present in a string?
>
> 1. Don't use pattern matching.
> 2. If speed is your utmost considration, write a C function to do the job
> and invoke it from your Perl script.
> IIRC, 80x86 machine language supports this kind of operation by
> prefixing an instruction with the rep prefix.
> 3. If speed is not that big concern, implement a loop which scans the
> string character by character, and compare ord(char)&0x80 to zero.
>
Thanks for the proposal, but from the whole application point of view
I'd rather examine the entire string (some way to implement solution
#1)....
> --- Omer
> My opinions, as expressed in this E-mail message, are mine alone.
> They do not represent the official policy of any organization with which
> I may be affiliated in any way.
> WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.html
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://www.perl.org.il/mailman/listinfo/perl
>
> +++++++++++++++++++++++++++++++++++++++++++
> This Mail Was Scanned By Mail-seCure System
> at the Tel-Aviv University CC.
--
Roman M. Parparov - NASA EOSDIS project node at TAU technical manager.
Email: romm at empire.tau.ac.il http://www.nasa.proj.ac.il/
Phone/Fax: +972-(0)3-6405205 (work), +972-(0)51-34-18-34 (home)
----------------------------------------------------------------------
The economy depends about as much on economists as the weather does on
weather forecasters.
-- Jean-Paul Kauffmann
More information about the Perl
mailing list