Is it possible to split a string (possibly with regex) so that every other number is a pair(starting from the right hand end)?
// 1 [1]
// 12 [12]
// 123 [1,23]
// 1234 [1,2,34]
// 12345 [12,3,45]
// 123456 [1,23,4,56]
// 1234567 [1,2,34,5,67]
// 12345678 [12,3,45,6,78]
// 123456789 [1,23,4,56,7,89]
// 1234567890 [1,2,34,5,67,8,90]
I tried reversing the string & then adding blocks of alternating two and one characters till the end (front) of the string. Then reversing it again. That mainly worked but it was flawed (didn't work for all cases). I also tried the regex
(\d\d)(\d)(\d\d)(\d)(\d\d)(\d)
But that doesn't work either (only in the regex tester ironically) - it's too long but I'll need it to work for 10 digit numbers max.
// 1234 [1,2,34]maybe this// 1234 [12,34]?