Looking at the screenshot you posted, its not just spaces, you've set up a multi-line text field, so you can have carriage return and line feed characters as well, also looks like you have double spaces... that's quite a challenge!
However, all of the above conditions don't really matter if we instead just take out everything else except the numbers, split that into rows, add row numbers, then after every tenth we insert a semi-colon.
To do this,
The OnChange of your txt_OrderNumbers control becomes:
Set(gblOldText, Self.Text)
Then the Default property of the txt_OrderNumbers control becomes:
Concat(
ForAll(
ForAll(
Sequence(
CountRows(
Split(
Concat(
Split(
gblOldText,
""
),
If(
IsMatch(
Result,
"[0-9]"
),
Result
)
),
""
)
)
),
{
ThisNum: Last(
FirstN(
Split(
Concat(
Split(
gblOldText,
""
),
If(
IsMatch(
Result,
"[0-9]"
),
Result
)
),
""
),
Value
)
).Result,
ThisRowNum: Value
}
),
ThisRecord.ThisNum & If(
!(ThisRowNum = 0) && Mod(
ThisRecord.ThisRowNum,
10
) = 0,
";",
""
)
),
Value
)
If you are wondering why we have to move the original text to a variable, this is to avoid the circular reference caused by referencing itself.

I have included a proof of concept app you can download and check for yourself 🙂
Cheers,
Sancho