Code: Select all
Loop % People.MaxIndex() {
RegExMatch(People[A_Index].Status, "\(\d+/", People[A_Index].Value)
StringTrimLeft, People[A_Index].Value, People[A_Index].Value, 1
StringTrimLeft, People[A_Index].Value, People[A_Index].Value, 1
}
(EDIT:) RegEx does work outside the loop. I want the value between ( and / to be stored in another array. People[Number].Value
Full Code (is proper):
Code: Select all
TestTexti =
(
Name1
Status - (10/10)
Name2
Status - (4/10)
Name3
Status - (6/10)
)
Array := StrSplit(TestTexti, "`n")
splitArray := StrSplit(TestTexti, "`n")
People := {}
Loop, % splitArray.MaxIndex() {
if (Mod(A_Index, 2) == 0) {
continue
}
person := {}
person.Name := splitArray[A_Index]
person.status := splitArray[A_Index + 1]
People.push(person)
}