$js = <<<JS
...
const urls = ["url","url2","url3"];
let url = urls[0];
...
JS;
preg_match('/urls = \[((?:"([^"]+)",?)+)\]/u', $js, $matches);
не знаю?
$js = <<<JS
...
const urls = ["url","url2","url3"];
let url = urls[0];
...
JS;
preg_match_all('/"([^"]+)"/',$js,$array);
var_dump($array[0]);
'/(?:urls = \["(?=[^"]+(?:","[^"]+)+"\];)|(?!^)\G",")([^"]+)/u'