Sergey_New,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<textarea name="">
0 HEAD
1 SOUR AGES
2 VERS 2.0.4
</textarea>
<script>
var a = document.querySelector("textarea").value, k = [];
a.replace(/^(\d+)\s(\w*)\s*?((\S.*?)?$)/gim, function(s,a,b,c) {
k.push([a,b,c])
return s
});
alert(JSON.stringify(k))
</script>
</body>
</html>