A
aleko.petkov
Hi
I am trying to get the message IDs returned by the LIST command into a
string list.
For example, given the following input string:
+OK 5 Messages( 4099 octets )
1 9163
2 6962
3 8953
produce { "9163", "6969", "8953" }.
using the following code:
string[] msgIDs = Regex.Split( response, @"\d+ (\d+)",
RegexOptions.Singleline );
This sort of works, except that the resulting array includes
non-matches as well. Is it possible to return only the group values
this way, or do I have to fiddle with MatchCollections, and Groups?
Thanks,
Aleko
I am trying to get the message IDs returned by the LIST command into a
string list.
For example, given the following input string:
+OK 5 Messages( 4099 octets )
1 9163
2 6962
3 8953
produce { "9163", "6969", "8953" }.
using the following code:
string[] msgIDs = Regex.Split( response, @"\d+ (\d+)",
RegexOptions.Singleline );
This sort of works, except that the resulting array includes
non-matches as well. Is it possible to return only the group values
this way, or do I have to fiddle with MatchCollections, and Groups?
Thanks,
Aleko