On Sun, Oct 07, 2007 at 14:11:33 +0200, Ernst, Yehuda wrote:
> Hello!
> 
> I want to use range like 
> 
> 
> [a-z]
> 
> but in Hebrew from [א-ת]
> 
> How do i do it in perl?


#!/usr/bin/perl

use strict;
use warnings;

use utf8; # this is the important bit, it lets the א-ת be
interpreted as
# unicode characters, and makes sure the strings in the qw() are
# also unicode

binmode STDOUT, ":utf8"; # to prevent the wide character in print
warning

foreach my $string qw(שלום hello) {
        print "string matches: $string\n" if $string =~ /[א-ת]/;
}

string matches: שלום

-- 
  Yuval Kogman <[EMAIL PROTECTED]>
http://nothingmuch.woobling.org  0xEBD27418

_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl

Reply via email to