The focused string is :
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16;
I want to match the first 16 numbers. In regex101, I can use the Regex:
((\d{2}|\d)(\,\d{2}|\,\d){15}(\;))
the (\,\d{2}|\,\d){15} means match (\,\d{2}|\,\d) 15 times. But this token doesn't work in KM.
In KM, If I use
((\d{2}|\d)(\,\d{2}|\,\d){15}(\;))
the (\,\d{2}|\,\d){15} only match the 15th number.
I cannot find the correct way to do this, So I have to use this:
((\d{2}|\d)(,\d{2}|,\d)(,\d{2}|,\d)(,\d{2}|,\d)(,\d{2}|,\d)(,\d{2}|,\d)(,\d{2}|,\d)(,\d{2}|,\d)(,\d{2}|,\d)(,\d{2}|,\d)(,\d{2}|,\d)(,\d{2}|,\d)(,\d{2}|,\d)(,\d{2}|,\d)(,\d{2}|,\d)(,\d{2}|,\d)(\;))
(note that in this post, it's (\,\d{2}|,\d) actually, but This forum page show it in (,\d{2}|,\d). The first '\' was hidden. Don't know why!!!!!!)
This Regex works, but not elegant and smart.
So I want to know how to use Regex to match previous token multiple times in KM.
(I mean how to do (\,\d{2}|,\d)){15} in KM?)
And another question is that you see the focused string is that combined with four 16-numbers-group. Is there a way to match them one group by one group at a time?
Here is the KMM:
Regex Question - how to match previous token multiple times v0_Backup_20220827_2216_v0.kmmacros (4.4 KB)