Given input is always going to start with 0 and then follow as:
c1 + occurrence where c1 is the character and occurrence is the sequence of the same character repeating.
For example aabbaaacccc becomes 0a2b2a3c4, characters will be always lowercase a-z.
Now my issue is given input as:
0x1k1c4t11g3d1m1d1j10f1v1n3e2r3i1e2a1h4a2e1y1z2e1s1a1q1j2r1k2t3h1i1f4j1d2m4p3
However when I use String.split() and iterate through the results I am getting empty strings. I tried using both split("[0-9]") and split("[^a-z]") but result does not change.
The iteration result for my example is:
x
k
c
t
g
d
m
d
j
f
v
n
e
r
i
e
a
h
a
e
y
z
e
s
a
q
j
r
k
t
h
i
f
j
d
m
p
Is this a bug in JDK or is there something wrong with my regex?
11), you'll end up seeing an empty string, because there's nothing between those two digits.