Svea/Helper/Helper.php
/**
     * Takes a streetaddress string and splits the streetname and the housenumber, returning them in an array
     * Handles many different street address formats, see test suite SplitAddressTest.php test cases for examples.
     * 
     * If no match found, will return input streetaddress in position 0 and streetname, empty string in housenumber positions.
     * 
     * @param string $address --
     * @return string -- array with the entire streetaddress in position 0, the streetname in position 1 and housenumber in position 2 
     */
Takes a streetaddress string and splits the streetname and the housenumber, returning them in an array
Handles many different street address formats, see test suite SplitAddressTest.php test cases for examples.

If no match found, will return input streetaddress in position 0 and streetname, empty string in housenumber positions.

@param string $address
@return string -- array with the entire streetaddress in position 0, the streetname in position 1 and housenumber in position 2
Takes a streetaddress string and splits the streetname and the housenumber returning them in an array Handles many different street address formats see test suite SplitAddressTest . php test cases for examples . If no match found will return input streetaddress in position 0 and streetname empty string in housenumber positions . @param string $address @return string -- array with the entire streetaddress in position 0 the streetname in position 1 and housenumber in position 2
static function splitStreetAddress($address){
        $pattern = 
                "/^".                       
                "(?:\s)*".                  
                "(\X*?)?".                  
                "(?:[\s,])+".               
                "(\pN+\X*?)?".              
                "(?:\s)*".                  
                "$/u"                       
        ;       
        preg_match($pattern, $address, $addressArr);
        if( !array_key_exists( 2, $addressArr ) ) { $addressArr[2] = ""; }          
        if( !array_key_exists( 1, $addressArr ) ) { $addressArr[1] = $address; }    
        if( !array_key_exists( 0, $addressArr ) ) { $addressArr[0] = $address; }    
        return $addressArr;
    }
static function splitStreetAddress ( $ address ) { $ pattern = " /^ " . " (?:\s)* " . " (\X*?)? " . " (?:[\s,])+ " . " (\pN+\X*?)? " . " (?:\s)* " . " $/u " ; preg_match ( $ pattern , $ address , $ addressArr ) ; if ( ! array_key_exists ( 2 , $ addressArr ) ) { $ addressArr [ 2 ] = " " ; } if ( ! array_key_exists ( 1 , $ addressArr ) ) { $ addressArr [ 1 ] = $ address ; } if ( ! array_key_exists ( 0 , $ addressArr ) ) { $ addressArr [ 0 ] = $ address ; } return $ addressArr ; }
Takes a streetaddress string and splits the streetname and the housenumber, returning them in an array
 Handles many different street address formats, see test suite SplitAddressTest.php test cases for examples.
Takes a streetaddress string and splits the streetname and the housenumber returning them in an array Handles many different street address formats see test suite SplitAddressTest . php test cases for examples .
//Separates the street from the housenumber according to testcases, handles unicode combined code points // start of string // non-matching group, consumes any leading whitespace // streetname group, lazy match of any graphemes // non-matching group, 1+ separating whitespace or comma // housenumber group, something staring with 1+ number, followed w/lazy match of any graphemes // non-matching group, consumes any trailing whitespace // end of string, use unicode // fallback if no match w/regexp //fix for addresses w/o housenumber //fix for no match, return entire input as streetname