use strict;
my $str = '1 Май
-
Май 25\\5
Ӑ ӑ
Ӓ ӓ
Ә ә
Ӛ ӛ
Ӕ ӕ
Б б
В в
Г г
Ґ ґ
Ѓ ѓ
Ғ ғ
Ӷ ӷ
Ҕ ҕ
Д д
Ђ ђ
Е е
Ѐ ѐ
Ё ё
Ӗ ӗ
Ҽ ҽ
Ҿ ҿ
Є є
Ж ж
Ӂ ӂ
Җ җ
Ӝ ӝ
З з
З́ з́
Ҙ ҙ
Ӟ ӟ
Ӡ ӡ
Ѕ ѕ
И и
Ѝ ѝ
Ӥ ӥ
Ӣ ӣ
І і
Ї ї
Ӏ ӏ
Й й
Ҋ ҋ
Ј ј
К к
Қ қ
Ҟ ҟ
Ҡ ҡ
Ӄ ӄ
Ҝ ҝ
Л л
Ӆ ӆ
Љ љ
М м
Ӎ ӎ
Н н
Ӊ ӊ
Ң ң
Ӈ ӈ
Ҥ ҥ
Њ њ
О о
Ӧ ӧ
Ө ө
Ӫ ӫ
Ҩ ҩ
П п
Ҧ ҧ
Р р
Ҏ ҏ
С с
С́ с́
Ҫ ҫ
Т т
Ҭ ҭ
Ћ ћ
Ќ ќ
У у
Ў ў
Ӳ ӳ
Ӱ ӱ
Ӯ ӯ
Ү ү
Ұ ұ
Ф ф
Х х
Ҳ ҳ
Һ һ
Ц ц
Ҵ ҵ
Ч ч
Ӵ ӵ
Ҷ ҷ
Ӌ ӌ
Ҹ ҹ
Џ џ
Ш ш
Щ щ
Ъ ъ
Ы ы
Ӹ ӹ
Ь ь
Ҍ ҍ
Э э
Ӭ ӭ
Ю ю
Я я
abcdefgh
012344';
my $regex = qr/^[\p{Cyrillic}0-9\s-#$%^&\\]+$/mp;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html