Repeating paterns within paterns
Posted: Mon Nov 27, 2006 8:16 am
Hi,
I have to decode a string, which contains some repeating elements and continues as a generic text. Example:
OCT 28 29 NOV 03 04 05 10 11 DAILY 0800-SS NOV 15 18 23 DAILY SR-SS NOV 24 26 0700-1500 blablabla blabla
output should be an array like
[0][0] = {OCT,28,29,NOV,03,04,05,10,11} // month and days
[0][1] = {0800,SS} // start and end data - SS = sunset, SR = sunrise
[1][0] = {NOV,15,18,23}
[1][1] = {SR,SS}
[2][0] = {NOV,24,26}
[2]10] = {0700,1500}
I am not able to construct such a patern. Please, could anybody help me?
M.
I have to decode a string, which contains some repeating elements and continues as a generic text. Example:
OCT 28 29 NOV 03 04 05 10 11 DAILY 0800-SS NOV 15 18 23 DAILY SR-SS NOV 24 26 0700-1500 blablabla blabla
output should be an array like
[0][0] = {OCT,28,29,NOV,03,04,05,10,11} // month and days
[0][1] = {0800,SS} // start and end data - SS = sunset, SR = sunrise
[1][0] = {NOV,15,18,23}
[1][1] = {SR,SS}
[2][0] = {NOV,24,26}
[2]10] = {0700,1500}
I am not able to construct such a patern. Please, could anybody help me?
M.