perl regex
Mike Starke
plug-discuss@lists.plug.phoenix.az.us
Wed, 26 Mar 2003 11:11:38 -0500
I am still struggling with an expression to parse
out a file of the following format:
FIELD: data, FIELD: more, data, FIELD: data ....
FIELD: data, FIELD: more, data, FIELD: data ....
FIELD: data, FIELD: more, data, FIELD: data ....
FIELD: data, FIELD: more, data, FIELD: data ....
I thought I had it, but notice above how some data has
a comma contained within; that pretty much ruined
my 'split' function :-)
Each line begins with the word 'TYPE', so I been able to weed
out everything in the file that is not relevant
by using something like:
if ($_ =~ /^TYPE.*/) {
Beyond this, I just can not seem to get the proper
expression to grab the fields and their cooresponding data.
Anyone?
v/r
-Mike