3v4l.org

run code in 300+ PHP versions simultaneously
<?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);

preferences:
44.45 ms | 402 KiB | 5 Q