0

I have the following regular expression:

(?<=(?![0-9])).+$

It currently selects only the first consecutive numbers in the input:

00067802:ygavet, tankt::math:ND
56710982:saturn; *Ustaris:fgK
Alexis:4D; %*BIOL
dadad:43414214
1daada
0d1d2

https://regex101.com/r/jmxPHT/1

How can I modify this now so that it adds commas into the number in blocks of three starting from the left?

So, returning the following

67,802
56,710,982


1
0
yai787
  • 11
  • Note you might need to also remove leading zeros before running the [comma insertion regex](https://regex101.com/r/jmxPHT/2), something like `^0+(?=\d)` / `(? – Wiktor Stribiżew Jul 28 '21 at 18:33

0 Answers0