original_string: protected function parse_response($response) {
          if (!preg_match($this->build_regex(), $response, $matches)) {
              return array(null, null, null, null);
          }
  
          $matches += array('', '', '', ''); // Fill in any missing matches.
          list($matchedpart, $beforepoint, $decimals, $exponent) = $matches;
  
          // Strip out thousands separators.
          $beforepoint = str_replace($this->thousandssep, '', $beforepoint);
  
          // Must be either something before, or something after the decimal point.
          // (The only way to do this in the regex would make it much more complicated.)
          if ($beforepoint === '' && $decimals === '') {
              return array(null, null, null, null);
          }
  
          if ($this->unitsbefore) {
              $unit = substr($response, 0, -strlen($matchedpart));
          } else {
              $unit = substr($response, strlen($matchedpart));
          }
          $unit = trim($unit);
  
          return array($beforepoint, $decimals, $exponent, $unit);
      }
code: protected function parse_response($response) {
          if (!preg_match($this->build_regex(), $response, $matches)) {
              return array(null, null, null, null);
          }
  
          $matches += array('', '', '', ''); // Fill in any missing matches.
          list($matchedpart, $beforepoint, $decimals, $exponent) = $matches;
  
          // Strip out thousands separators.
          $beforepoint = str_replace($this->thousandssep, '', $beforepoint);
  
          // Must be either something before, or something after the decimal point.
          // (The only way to do this in the regex would make it much more complicated.)
          if ($beforepoint === '' && $decimals === '') {
              return array(null, null, null, null);
          }
  
          if ($this->unitsbefore) {
              $unit = substr($response, 0, -strlen($matchedpart));
          } else {
              $unit = substr($response, strlen($matchedpart));
          }
          $unit = trim($unit);
  
          return array($beforepoint, $decimals, $exponent, $unit);
      }
code_tokens: protected function parse_response ( $ response ) { if ( ! preg_match ( $ this -> build_regex ( ) , $ response , $ matches ) ) { return array ( null , null , null , null ) ; } $ matches += array ( '' , '' , '' , '' ) ; // Fill in any missing matches. list ( $ matchedpart , $ beforepoint , $ decimals , $ exponent ) = $ matches ; // Strip out thousands separators. $ beforepoint = str_replace ( $ this -> thousandssep , '' , $ beforepoint ) ; // Must be either something before, or something after the decimal point. // (The only way to do this in the regex would make it much more complicated.) if ( $ beforepoint === '' && $ decimals === '' ) { return array ( null , null , null , null ) ; } if ( $ this -> unitsbefore ) { $ unit = substr ( $ response , 0 , - strlen ( $ matchedpart ) ) ; } else { $ unit = substr ( $ response , strlen ( $ matchedpart ) ) ; } $ unit = trim ( $ unit ) ; return array ( $ beforepoint , $ decimals , $ exponent , $ unit ) ; }
docstring: This method can be used for more locale-strict parsing of repsonses. At the
  moment we don't use it, and instead use the more lax parsing in apply_units.
  This is just a note that this funciton was used in the past, so if you are
  intersted, look through version control history.
  
  Take a string which is a number with or without a decimal point and exponent,
  and possibly followed by one of the units, and split it into bits.
  @param string $response a value, optionally with a unit.
  @return array four strings (some of which may be blank) the digits before
  and after the decimal point, the exponent, and the unit. All four will be
  null if the response cannot be parsed.
docstring_tokens: This method can be used for more locale - strict parsing of repsonses . At the moment we don t use it and instead use the more lax parsing in apply_units . This is just a note that this funciton was used in the past so if you are intersted look through version control history .