你能帮我纠正我的解析代码。复杂的行解析 - 需要帮助
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