求正则表达式。。哪位大哥帮帮忙???

来源:百度知道 编辑:UC知道 时间:2024/06/09 11:22:13
求匹配{%shoumenu(参数1,2,3)%}的正则表达式。。哪位大哥帮帮忙???
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<link href ="Skins/Default/Css.css" type="text/css" rel ="Stylesheet" />
</head>
<body>

<div id="BodyDiv">
<div class="TopLogo">
</div>
<div class="TopLeft">
{%shoumenu(1,2,3)%}
</div>

用的什么语言呢,原始数据贴几条,说一下你需要的结果。一般的语言可以使用下的正在表达式匹配:

/\{\%shoumenu\(\s+,2,3\)\%\}/

我写一个,我测试过了,不过楼主用的逗号好像是全角的,如果想要匹配的也是全角空格就把下边的逗号替换成全角的就可以了。
{%shoumenu\(.*?,.*?,.*?\)%\}