Last active
January 4, 2020 15:47
-
-
Save vyspiansky/e8419d2d0aba45f2f0921d24388321f9 to your computer and use it in GitHub Desktop.
PHP: split a word in capital Ukrainian letters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// PHP: split a word in capital Ukrainian letters | |
$pattern = '/[А-ЯҐЄІЇ][^А-ЯҐЄІЇ]*/u'; | |
$subject = 'АкулаҐаваЄнотІгуанаЇжак'; | |
preg_match_all($pattern, $subject, $matches); | |
print_r($matches); | |
// Output: [['Акула', 'Ґава', 'Єнот', 'Ігуана', 'Їжак']] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment