I have a string that might look something like this ...
'8110003099704499441399110600308123191010'
Out of this string I need to parse out whatever defined components may be there. The string is dynamic so it will change from one instance to the next. Further, each string may contain a different set of components.
To complicate matters, each components of the string is a variable length. For instance this part . . .
"0030997".
The first "0" indicates the length of the component following if that component is longer than 6 digits. In this example, that first digit is 0 so we know we only need to read the next 6 digits to get the component value. If however that value were 1, we would know we would have to read the next 7 (6 + 1) digits to get the component value . . . and so on.
Other than the first four digits of this string ("8110"), the balance of the string is formatted in the manner I described above.
Anyway, I am totally and 100% stumped on how to even remotely parse a string of this nature using Regular Expressions.
Anybody have any suggestions, clues, or code snippets I can copy from that will allow me to parse a string of this nature?
Any and all help is greatly appreciated.
Thank you!
Stay Cool Ya'll!![[smile2] [smile2] [smile2]](/data/assets/smilies/smile2.gif)
-- Kristin
'8110003099704499441399110600308123191010'
Out of this string I need to parse out whatever defined components may be there. The string is dynamic so it will change from one instance to the next. Further, each string may contain a different set of components.
To complicate matters, each components of the string is a variable length. For instance this part . . .
"0030997".
The first "0" indicates the length of the component following if that component is longer than 6 digits. In this example, that first digit is 0 so we know we only need to read the next 6 digits to get the component value. If however that value were 1, we would know we would have to read the next 7 (6 + 1) digits to get the component value . . . and so on.
Other than the first four digits of this string ("8110"), the balance of the string is formatted in the manner I described above.
Anyway, I am totally and 100% stumped on how to even remotely parse a string of this nature using Regular Expressions.
Anybody have any suggestions, clues, or code snippets I can copy from that will allow me to parse a string of this nature?
Any and all help is greatly appreciated.
Thank you!
Stay Cool Ya'll!
![[smile2] [smile2] [smile2]](/data/assets/smilies/smile2.gif)
-- Kristin