Skip to content

Instantly share code, notes, and snippets.

@vyspiansky
Last active January 4, 2020 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vyspiansky/e8419d2d0aba45f2f0921d24388321f9 to your computer and use it in GitHub Desktop.
Save vyspiansky/e8419d2d0aba45f2f0921d24388321f9 to your computer and use it in GitHub Desktop.
PHP: split a word in capital Ukrainian letters
<?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