I have a string which is of this form:
$str = "30M1I20M150N20M190N50M"
EDITED: I would like to split this string so that my ouput looks like this:
30M1I20M
150N
20M
190N
50M
However, when I tried with,
@split_str = split(/(\d+)N/, $str);
I get:
30M1I20M
150
20M
190
50M
As you can see, the N gets omitted in the result (150, 190 instead of 150N and 190N). Could anyone tell me how I should go about? Thank you!