original_string: public static function finish($value, $cap)
      {
          $quoted = preg_quote($cap, '/');
  
          return preg_replace('/(?:'.$quoted.')+$/u', '', $value).$cap;
      }
code: public static function finish($value, $cap)
      {
          $quoted = preg_quote($cap, '/');
  
          return preg_replace('/(?:'.$quoted.')+$/u', '', $value).$cap;
      }
code_tokens: public static function finish ( $ value , $ cap ) { $ quoted = preg_quote ( $ cap , '/' ) ; return preg_replace ( '/(?:' . $ quoted . ')+$/u' , '' , $ value ) . $ cap ; }
docstring: Cap a string with a single instance of a given value.
  
  @param  string  $value
  @param  string  $cap
  @return string
docstring_tokens: Cap a string with a single instance of a given value .