你能幫我糾正我的解析代碼。複雜的行解析 - 需要幫助
constant fixup privite ConfigAlarms = <U1 0> /* comment here*/
滑的我下面的代碼, 我不知道怎麼弄的U1
和0
和**/* comment here*/**
值。
if(/^\s*(constant)\s*(fixup|\/\*fixup\*\/|)\s*(private|)\s*(\w+)^ ...(Need help here.)
{
$name1 = $1; # for content
$name2 = $2; # for fixup
$name3 = $3; # for privite
$name4 = $4; # for ConfigALarms
$name5 = $5; # for U1
$name6 = $6; # for 0
$name7 = $7; # for /* comment here*/
謝謝您的指導
更新完成的代碼
if(/^\s*(constant)\s*(fixup|\/\*fixup\*\/|)\s*(private|)\s*(\w+)\s+=\s+<([a-zA-Z0-9]+)\s+([0-9]+)>\s*\/\*\s*(.*?)\s*\*\/(\r|\n|\s)/)
\ s +/*(。*?)* /無法用於評論部分。我改爲(從下面的ysth)\ s * \/* \ s *(。*?)\ s ** \ /。 IT現在工作。謝謝。 – 2009-12-22 08:07:31
對不起,我沒有注意到你在Perl中的事實。 – 2009-12-22 18:55:17