- print_r: documentation ( source)
- preg_match_all: documentation ( source)
- array_merge: documentation ( source)
<?php
$re = '~ ^ (?! .* [^\PL\p{Latin}] ) .+ $ ~mux';
$str = '
# good
alpha + beta = gamma
LHOOQ
13.70€
Gruvrået
....
oeuärē
a aaà
2323442
üúôÆaaë
# uglу <-- the "у" character is U+0443 CYRILLIC SMALL LETTER U (even if it\'s looks like the ASCII "y")
delta Δ
Дмитрий Дмитриевич Шостакович
طاهر بن جلون';
preg_match_all($re, $str, $matches, PREG_SET_ORDER);
// Print the entire match result
print_r(array_merge(...$matches));