Meta Values in Array and Note Tags in Array

On my old topics, some of you were able to teach me how to read the values of meta and compare arrays. But I just have recently been into it and still struggling to learn the regular expressions in Rubular and Scriptular as advised. I find meta easier to do but I discovered that I still don't know how to do arrays in it.

For example, I like to get the values of:

<skill_crack: 1, 2, 3, 4>

How can I store them in an array? And if I decide to store 1, 2, 3 and 4 in four separate variables, how can we do that?

Same goes with regular expressions.

Can someone give me a primer how we can store values from the following note tag style?

<skill_crack>

1, 2, 3, 4

</skill_crack>

skill_crack: 1, 2, 3, 4

or <skill_crack: 1, 2, 3, 4>

Because right now all I know is store just one variable. I keep trying arrays but just failed to do so.

Advanced thanks!
I don't know where you're placing that notetag, so I'll just use skills as an example

If you have

<skill_crack: 1, 2, 3, 4>

as a notetag, this should give you an array with the values as strings.

var noteArray = $dataskill[ID].meta.skill_crack.split(" ,");And from here on you can assign each of them to any variable you want.

For this pattern:

<skill_crack>

1, 2, 3, 4

</skill_crack>

or

<skill_crack>

1

2

3

4

</skill_crack>

You could create two regex to check the beginning and the end, like Yanfly does it for example.

Code:
var noteStart = /<(?:skill_crack)>/i;var noteEnd = /<\/(?:skill_crack)>/i;var noteArray = [];var group = $dataSkills;for (var n = 1; n < group.length; n++) {      var obj = group[n];      var notedata = obj.note.split(/[\r\n]+/);            var noteFlag = false;      for (var i = 0; i < notedata.length; i++) {	var line = notedata[i];	if (line.match(noteStart)) {	   noteFlag = true;	} else if (line.match(noteEnd)) {           noteFlag = false;        } else if (noteFlag) {           noteArray = notedata[i].split(" ,"); // If all numbers are in one line, otherwise you could use           // noteArray.push(notedata[i]);         }      }}

Original thread: https://forums.rpgmakerweb.com/threads/meta-values-in-array-and-note-tags-in-array.52274/