public static function reglace(String $file, $pattern, $replace) : String
    {
        $file = Info::rpath($file);

        if( ! is_file($file))
        {
            throw new Exception\FileNotFoundException(NULL, $file);
        }

        $contents        = file_get_contents($file);
        $replaceContents = Regex::replace($pattern, $replace, $contents);

        if( $contents !== $replaceContents )
        {
            file_put_contents($file, $replaceContents);
        }

        return $replaceContents;
    }
public static function reglace(String $file, $pattern, $replace) : String
    {
        $file = Info::rpath($file);

        if( ! is_file($file))
        {
            throw new Exception\FileNotFoundException(NULL, $file);
        }

        $contents        = file_get_contents($file);
        $replaceContents = Regex::replace($pattern, $replace, $contents);

        if( $contents !== $replaceContents )
        {
            file_put_contents($file, $replaceContents);
        }

        return $replaceContents;
    }
public static function reglace ( String $ file , $ pattern , $ replace ) : String { $ file = Info :: rpath ( $ file ) ; if ( ! is_file ( $ file ) ) { throw new Exception \ FileNotFoundException ( NULL , $ file ) ; } $ contents = file_get_contents ( $ file ) ; $ replaceContents = Regex :: replace ( $ pattern , $ replace , $ contents ) ; if ( $ contents !== $ replaceContents ) { file_put_contents ( $ file , $ replaceContents ) ; } return $ replaceContents ; }
Performs data modification on the file with ZN regex.

@param string $file
@param mixed  $pattern
@param mixed  $replace

@return string
Performs data modification on the file with ZN regex .