Kevin,
Try:
(
(
G(?<Gdata>\d+)
|
X(?<Xdata>\d+)
|
Y(?<Ydata>\d{2})
|
I(?<Idata>\d{1,2})
|
J(?<Jdata>\d+)
|
M(?<Mdata>\d+)
)
\s*
)+
I've spread this out over multiple lines so that you can see how it operates (you said you were doing a course so I'm assuming that you want to understand the pattern, nit just get an answer). Obviously, you should make this a single line or use the 'ignore whitespace' .NET option.
There are several variants in the lines because I'm not sure what you are really wanting. In your original question you shoe each letter followed by 2 X's and indicate that these are numbers. This would lead to the "\d{2}" style sub-pattern. However, you also give the example of "j0" which only has a single digit which means that "\d{1,2}" might be more approrpiate. Given that confusion, you might also have meant that there could be any number of digits after each letter, in which case the "\d+" pattern is more appropriate.
If you look at the returned named groups, you will find the corresponding number strings or 'null' as desired.
Susan
PS Lyndar's answer is also 'correct' because you are using the .NET regex engine - if you looked at the captures within the named matches you would see all of the results you asked for.