perl regex

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: Mike Starke
日付:  
題目: perl regex
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