I have a string like:
hn$8m3kj4.23hs@8;
i need to split it as follow: first entry should be of one char length, second entry of 2 chars, third entry of one char, fourth – by 2 chars and so on.
then concatenate one char with two chars entries by a semicolon :
if some chars at the end remains unpaired, they should be displayed as well.
it is important to skip all non alphanumeric chars.
so the final string should be:
h:n8 m:3k j:42 3:hs 8:
see, 8 has no 2 chars pair but it is displayed anyway.
i have tried with a loop but i get huge code.
also tried regexs but it split by wrong number of chars.
you can try this:
this will not skip underscores though.
if you need to skip them as well, use this one:
See live demo here