Finding if a line contains Hebrew characters in perl
ik
idokan at gmail.com
Fri Apr 26 12:01:55 IDT 2013
On Fri, Apr 26, 2013 at 9:24 AM, Gabor Szabo <szabgab at gmail.com> wrote:
> On Thu, Apr 25, 2013 at 6:05 PM, ik <idokan at gmail.com> wrote:
> > 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";
> > }
>
> I'd probably use \p{IsHebrew} or \p{InHebrew} instead of the hexa code.
>
For some strange reason it did not worked for me, so I resorted into hex
code :(
> Check here: http://perldoc.perl.org/perluniprops.html to learn way more
> than
> you'd probably want to :)
>
> I also CC-ed Meir Guttman who is *the* Perl Unicode expert.
> He might have something more correct to suggest.
>
> Gabor
>
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20130426/038e4d8b/attachment.html>
More information about the Linux-il
mailing list