$re = '/[\xC0-\xD6\xD8-\xF6\xF8-\xFF\x{100}-\x{2AF}\x{388}-\x{3EF}]/m';
$str = 'Different languages to test:
Napiszę tutaj trochę po polsku, żeby uzyskać znaki specjalne. To jest tylko do testowania. Szybki brązowy lis przeskoczył nad leniwym psem.
Unë thjesht do të shkruaj disa gjëra shqipe këtu për të marrë karaktere të veçanta. Kjo është vetëm për testim. Dhelpra e shpejtë kafe u hodh mbi qenin dembel.
Mən burada xüsusi personajlar əldə etmək üçün bir az azərbaycanca yazılar yazacam. Bu sadəcə sınaq üçündür. Sürətli qəhvəyi tülkü tənbəl itin üstündən atladı.';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
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 PHP, please visit: http://php.net/manual/en/ref.pcre.php