3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $strings = [ 'av. St Joan 128', 'Av. st joan 122', 'av. St joan 212', 'Av. St.joan 121', 'AV. st joan 232' ]; $results = preg_grep('~^[^A-Z]*[A-Z]?[^A-Z]*$~', $strings); print_r($results);
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
Array ( [1] => Av. st joan 122 [2] => av. St joan 212 )