【发布时间】:2009-12-22 06:18:05
【问题描述】:
你能帮我更正我的解析代码吗?
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)/)
【问题讨论】: