<?php
$text = "Cell1 : 3300 mV\n";
if (preg_match('/Cell(\\d+)\\s*:\\s*(\\d+)/', $text, $m)) {
    $data = ['cell' => $m[1], 'voltage_mv' => $m[2], 'path' => '/rack/1'];
    echo json_encode($data, JSON_UNESCAPED_SLASHES), PHP_EOL;
}
