To outline: I have a parser that grabs Cell references using the following regex
‘$’?{letter}{1,2}’$’?{digit}{1,3}
I cant seem to find an elegant way to split the resulting char* into its row, and column components.
ex. split a1 into a and 1 or split $aa$4 into fixed_col a fixed row 4
Any help is appreciated.
Are you using a regex library? If so does it support accessing grouped parts of the regex, something like:
(This article shows the technique using the .NET regex library)
If that isn’t an option, then building a simple state machine would work well, and be easy to maintain and test.