library/PostcodeNl/Api/RestClient.php
public function splitHouseNumber($houseNumber)
	{
		$houseNumberAddition = '';
		if (preg_match('~^(?<number>[0-9]+)(?:[^0-9a-zA-Z]+(?<addition1>[0-9a-zA-Z ]+)|(?<addition2>[a-zA-Z](?:[0-9a-zA-Z ]*)))?$~', $houseNumber, $match))
		{
			$houseNumber = $match['number'];
			$houseNumberAddition = isset($match['addition2']) ? $match['addition2'] : (isset($match['addition1']) ? $match['addition1'] : '');
		}

		return [$houseNumber, $houseNumberAddition];
	}
public function splitHouseNumber($houseNumber)
	{
		$houseNumberAddition = '';
		if (preg_match('~^(?<number>[0-9]+)(?:[^0-9a-zA-Z]+(?<addition1>[0-9a-zA-Z ]+)|(?<addition2>[a-zA-Z](?:[0-9a-zA-Z ]*)))?$~', $houseNumber, $match))
		{
			$houseNumber = $match['number'];
			$houseNumberAddition = isset($match['addition2']) ? $match['addition2'] : (isset($match['addition1']) ? $match['addition1'] : '');
		}

		return [$houseNumber, $houseNumberAddition];
	}
public function splitHouseNumber ( $ houseNumber ) { $ houseNumberAddition = '' ; if ( preg_match ( '~^(?<number>[0-9]+)(?:[^0-9a-zA-Z]+(?<addition1>[0-9a-zA-Z ]+)|(?<addition2>[a-zA-Z](?:[0-9a-zA-Z ]*)))?$~' , $ houseNumber , $ match ) ) { $ houseNumber = $ match [ 'number' ] ; $ houseNumberAddition = isset ( $ match [ 'addition2' ] ) ? $ match [ 'addition2' ] : ( isset ( $ match [ 'addition1' ] ) ? $ match [ 'addition1' ] : '' ) ; } return [ $ houseNumber , $ houseNumberAddition ] ; }
Split a housenumber addition from a housenumber.

Examples: "123 2", "123 rood", "123a", "123a4", "123-a", "123 II"
(the official notation is to separate the housenumber and addition with a single space)

@param string $houseNumber
@return array Array with houseNumber and houseNumberAddition values
Split a housenumber addition from a housenumber .