3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $pattern = '/ (?x) # free-spacing modifier ^ # start of the line [[:space:][:punct:]]* # ignore any leading trash (?P<street>[[:alpha:][:space:]]+[[:alpha:]]) # street name (any letter from any language) [[:space:][:punct:]]* # separator (?P<house> # house group [[:digit:]] # must start with the digit [[:digit:][:alpha:][:space:][:punct:]]* # any continue with digit, letter, space or punctuation (if necessary) ) [[:space:][:punct:]]* # ignore any trailing trash (not working) $ # end of the line /u'; $sample = 'Potsdamer Strae 124-126'; echo (int)preg_match( $pattern, $sample, $matches).PHP_EOL; print_r($matches);
based on 1u5dD
Output for 5.3.18 - 7.2.0
0 Array ( )