Finding if a line contains Hebrew characters in perl
ik
idokan at gmail.com
Thu Apr 25 18:05:22 IDT 2013
try this
#!/usr/bin/env perl -w
#
use v5.14;
use utf8;
my $text = 'שלוabv';
if ($text =~ /^[\x{5D0}-\x{5ea}]{3}/) {
say "yes";
} else {
say "no";
}
On Thu, Apr 25, 2013 at 5:47 PM, Ori Idan <ori at helicontech.co.il> wrote:
>
>
>
> On Thu, Apr 25, 2013 at 5:21 PM, ik <idokan at gmail.com> wrote:
>
>>
>> On Thu, Apr 25, 2013 at 5:17 PM, Ori Idan <ori at helicontech.co.il> wrote:
>>
>>> I have a script in perl where I read lines from a UTF-8 text file.
>>> I have to find out if a line contains at least 3 letters in Hebrew.
>>>
>>> How can this be done in perl?
>>>
>>
>> What is your Perl version ?
>>
>
> Perl 5 version 14.2
>
> --
> Ori Idan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20130425/308b9749/attachment.html>
More information about the Linux-il
mailing list