3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '~ ^ [^\pL\r\n]* (?=\p{Latin}) (*asr: .+ ) $ ~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 8.1.5 - 8.1.33, 8.2.10 - 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] => Gruvrået [4] => oeuärē [5] => a aaà [6] => üúôÆaaë )

preferences:
39.67 ms | 406 KiB | 5 Q