original_string: private static function updateMac($string)
      {
          $string = mb_ereg_replace_callback('\b(Ma?c)([A-Za-z]+)', function ($matches) {
              return $matches[1] . mb_strtoupper(mb_substr($matches[2], 0, 1)) . mb_substr($matches[2], 1);
          }, $string);
  
          // Now fix "Mac" exceptions
          foreach (self::$exceptions as $pattern => $replacement) {
              $string = mb_ereg_replace($pattern, $replacement, $string);
          }
  
          return $string;
      }
code: private static function updateMac($string)
      {
          $string = mb_ereg_replace_callback('\b(Ma?c)([A-Za-z]+)', function ($matches) {
              return $matches[1] . mb_strtoupper(mb_substr($matches[2], 0, 1)) . mb_substr($matches[2], 1);
          }, $string);
  
          // Now fix "Mac" exceptions
          foreach (self::$exceptions as $pattern => $replacement) {
              $string = mb_ereg_replace($pattern, $replacement, $string);
          }
  
          return $string;
      }
code_tokens: private static function updateMac ( $ string ) { $ string = mb_ereg_replace_callback ( '\b(Ma?c)([A-Za-z]+)' , function ( $ matches ) { return $ matches [ 1 ] . mb_strtoupper ( mb_substr ( $ matches [ 2 ] , 0 , 1 ) ) . mb_substr ( $ matches [ 2 ] , 1 ) ; } , $ string ) ; // Now fix "Mac" exceptions foreach ( self :: $ exceptions as $ pattern => $ replacement ) { $ string = mb_ereg_replace ( $ pattern , $ replacement , $ string ) ; } return $ string ; }
docstring: Updates irish Mac & Mc.
  
  @param string $string
  
  @return string
docstring_tokens: Updates irish Mac & Mc .