At 11:42 +0000 29/9/11, Hamann, T.D. (Thomas) wrote:

I need to write a regex that matches any single Greek letter followed by a hyphen in a UTF-8 text file that is otherwise in English.

How can I match the Greek alphabet (lower and upper case)?

#!/usr/local/bin/perl
use strict;
use utf8;
use encoding 'utf-8';
$_ = "Ναυσικάα, τί νύ σ᾽ ὧ-δε μεθήμονα γείνατο μήτηρ;";
print $1 if /(\p{Greek}-)/;

This will match polyhinic Greek as well, as you will see if you put a hyphen after any letter in $_

JD

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to