Skip to content
Prev 208996 / 398500 Next

String Manipulation- Extract numerical and alphanumerical segment

I am currently attempting to split a long list of strings (let's call it
"string.list") that is of the format:

"1234567.z3.abcdef-gh.12"

I have gotten it to:
"1234567"  "z3"  "abcdef-gh"  "12"
by use of the strsplit function.

This leaves me with each element of "string.list" having a split string of
the above format. What I'd like to do now is extract the first two strings
of each element in "string.list" -- the "1234567" and the "z3" -- and place
them into two separate lists, say, "firstsplit.numeric.list" and
"secondsplit.alphanumeric.list"

I'm having some trouble figuring out how to do this. Any help would be
greatly appreciated!