I am trying to extract information from a string - to format fortran string. The string is formatted as follows:
F8.3, I5, 3(5X, 2(A20,F10.3)), 'XXX'
with formatting fields separated by "," and formatting groups inside the brackets, with a number in front of the brackets indicating how many times the formatting pattern is repeated. Thus, the line above expands to:
F8.3, I5, 5X, A20,F10.3, A20,F10.3, 5X, A20,F10.3, A20,F10.3, 5X, A20,F10.3, A20,F10.3, 'XXX'
I am trying to do something in C # that will expand the string matching this pattern. I started to work around this with a lot of switches and if there were statements, but I wonder if I am not mistaken in this?
I was wondering if any Regex wizzard thinks that regular expressions can do it in one fell swoop? I donβt know anything about regular expressions, but if this can solve my problem, Iβm thinking about learning how to use them after a while ... on the other hand, if regular expressions can't figure it out, then I would rather spend looking to another method.