$parameterText = preg_replace( '/^[\p{P}\p{Z}\p{C}]+/u', '', $parameterText ); return array( new self( self::$flipMagicWordKeys[ $id ] ), $parameterText ); } else { return array( Null, $parameterText ); } } /** * Delete when moving to PHP 3.3 and use late static binding in WCParameterEnum. */ public static function matchPartAndNumber( $parameterText ) { # Extract number and remove number, white spaces and punctuation. if ( preg_match( '/\d+/u', $parameterText, $matches ) ) { $numString = $matches[0]; $num = (int) $numString; $parameterText = preg_replace( '/' . $numString . '|[\p{P}\p{Z}\p{C}]+/uS', '', $parameterText ); } else { $num = 1; } # Match what remains. $id = self::$magicWordArray->matchStartToEnd( $parameterText ); if ( $id ) { return array( new self( self::$flipMagicWordKeys[ $id ] ), $num ); } else { return array( Null, $num ); } } } WCPropertyEnum::init();