22declare(strict_types=1);
24namespace pocketmine\command\utils;
27use
function preg_last_error_msg;
28use
function preg_match_all;
29use
function preg_replace;
33 private function __construct(){
50 preg_match_all(
'/"((?:\\\\.|[^\\\\"])*)"|(\S+)/u', $commandLine, $matches);
51 foreach($matches[0] as $k => $_){
52 for($i = 1; $i <= 2; ++$i){
53 if($matches[$i][$k] !==
""){
55 $match = $matches[$i][$k];
56 $args[(int) $k] = preg_replace(
'/\\\\([\\\\"])/u',
'$1', $match) ??
throw new AssumptionFailedError(preg_last_error_msg());
static parseQuoteAware(string $commandLine)