I have an app that performs a great deal of parsing of existing ASCII text files. Its running fine using various string manipulation gymnastics. Obviously there are scenarios where regular expressions will work better, but Im having a hard time getting my head around the required cerebral contortions that regular expressions require. eg
I have a a text file (in a different language - DMIS) that may declare variable in a number of different ways. I would like to extract the variable names from the text for later use.
The code could appear anywhere in the file as any of the following:
DECL/REAL, var1, var2, var2
or
DECL/REAL,GLOBAL, var1, var2, var3
or
DECL/REAL,COMMON, var1, var2,var3
etc etc
This is probably simple the RegEx gurus
Any suggetions to extract the variable names using regular expressions would be welcomed!
I have a a text file (in a different language - DMIS) that may declare variable in a number of different ways. I would like to extract the variable names from the text for later use.
The code could appear anywhere in the file as any of the following:
DECL/REAL, var1, var2, var2
or
DECL/REAL,GLOBAL, var1, var2, var3
or
DECL/REAL,COMMON, var1, var2,var3
etc etc
This is probably simple the RegEx gurus
Any suggetions to extract the variable names using regular expressions would be welcomed!