3v4l.org

run code in 300+ PHP versions simultaneously
<?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));
Output for 5.6.40, 8.1.5 - 8.1.33, 8.2.1 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
Array ( [0] => # good [1] => alpha + beta = gamma [2] => LHOOQ [3] => 13.70€ [4] => Gruvrået [5] => .... [6] => oeuärē [7] => a aaà [8] => 2323442 [9] => üúôÆaaë )

preferences:
66.29 ms | 407 KiB | 5 Q