Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: unicode [A-F] equivalent?

by ambrus (Abbot)
on Mar 22, 2005 at 19:23 UTC ( [id://441585]=note: print w/replies, xml ) Need Help??


in reply to unicode [A-F] equivalent?

If you use locale, then the string comparision operators (and the default sort block too) will sort by the current locale, as given by LC_COLLATE. For example, this code

LC_ALL=hu_HU perl -wle 'use locale; print join " ", sort "op\xf3\xf5\x +f6"=~/\S/g;'
gives the correct order of the letters: o ó ö ő p.

Thus, instead of a regular expression such as m/^[A-Fa-f]/, you could use a comparision like $_ ge "g". I don't know how you can do this with regular expressions.

(Updated one typo.)

Replies are listed 'Best First'.
Re^2: unicode [A-F] equivalent?
by qq (Hermit) on Mar 23, 2005 at 14:49 UTC

    This looks like the most 'correct' solution, thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://441585]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-20 02:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found