src/Tasks.php
protected function replaceArraySetting($file, $key, $value) {
    $this->taskReplaceInFile($file)
      ->regex("/'$key' => '[^'\\\\]*(?:\\\\.[^'\\\\]*)*',/s")
      ->to("'$key' => '". $value . "',")
      ->run();
  }
protected function replaceArraySetting($file, $key, $value) {
    $this->taskReplaceInFile($file)
      ->regex("/'$key' => '[^'\\\\]*(?:\\\\.[^'\\\\]*)*',/s")
      ->to("'$key' => '". $value . "',")
      ->run();
  }
protected function replaceArraySetting ( $ file , $ key , $ value ) { $ this -> taskReplaceInFile ( $ file ) -> regex ( "/'$key' => '[^'\\\\]*(?:\\\\.[^'\\\\]*)*',/s" ) -> to ( "'$key' => '" . $ value . "'," ) -> run ( ) ; }
Use regex to replace a 'key' => 'value', pair in a file like a settings file.

@param $file
@param $key
@param $value
Use regex to replace a key = > value pair in a file like a settings file .