I try to parse ini file, the first string is empty string, but others okay:
Structure:
[sensor1]
param1: value
[sensor2]
param1 : value
param2 : value
And my code is:
success: function(data) {
var parsedArr = data.split(/\s*\[(.*)\]\s*\n/);
console.log(parsedArr);
}
Result:
0: ""
1: "sensor1"
2: "name: brightness temperature↵
3: "sensor2"
4: "name: brightness temp. IR↵device: HATPRO↵group:
length: 5
Is it okay? And how to solve it?
Thanks in advance :)