Hi, first of all this is my first question here. Pls understand if any mistakes are there.
I am new to regular expression. I am having the range of numbers 1–65535.
If numbers are coming in sequence like 1, 2, 3, 4…65535 I need to put padding of zeros at start to make them all in same length (fixed 5 digit length).
Output should be like (just add padding of zeros to make fix length):
00001
00002
…
01245
78657
I know we can use string.format function in Java.
String.format("%05d", str);
Pls, Don't evaluate above from syntax pov.
I am strongly looking for regex for the solution. Because the regex implementation is provided to support and will not impact my code. It will be great if explanation is also provided.
Thanks for supporting.