If the data is consistent enough you could do this without regex by using Substr with Contains (and Length)
Names Default To Here(1);
text ="UDI# 123456789123456789123456789456123
Device received, missing cover.
Major Reason For Service: xxxxxxxxxx
System usage: 2372
System PM due in: 7627
xxx usage: 120
yyy usage: 208";
stringToSearch = "System usage: ";
sysUsage = num(Substr(text, Contains(text, stringToSearch) + length(stringToSearch), 4));
show(sysUsage);
Edit1: Or by using Words and Word:
Names Default To Here(1);
text ="
UDI# 123456789123456789123456789456123
Device received, missing cover.
Major Reason For Service: xxxxxxxxxx
System usage: 2372
System PM due in: 7627
xxx usage: 120
yyy usage: 208";
list_of_rows = Words(text, "\!N");
Show(list_of_rows);
sysUsage = Word(3, list_of_rows[4]);
Show(sysUsage);
Edit2:
And finally regex with same text:
Names Default To Here(1);
text ="
UDI# 123456789123456789123456789456123
Device received, missing cover.
Major Reason For Service: xxxxxxxxxx
System usage: 2372
System PM due in: 7627
xxx usage: 120
yyy usage: 208";
//note "\2"
matchRegex = Regex(text, "(System usage: )(\d{1,5})", "\2");
Show(matchRegex);
//note index of number
matchList = Regex Match(text,"(System usage: )(\d{1,5})");
Show(matchList);
Show(matchList[3]);
-Jarmo