求教:正则表达式控制url内容 比如/PointForum/Forum/PostTopic.aspx 怎么用正则表达式 只输出PointForum 求大能。。 谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个不需要正则: string s = @"/PointForum/Forum/PostTopic.aspx"; Response.Write(Path.GetFileName(s)); 这个是用JS控制的 不是在cs里面. var str="/PointForum/Forum/PostTopic.aspx";alert(/[^\/]+(?=\/)/.exec(str)); <script>var groups=/\/([^/?]+)$/.exec("/PointForum/Forum/PostTopic.aspx");alert(groups[1]);</script> <script language="javascript" type="text/javascript">var folder=window.location.pathname;var f=new Array();f=folder.split("/");alert("文件夹地址为:"+f[1]);</script>我用这种搞定了 谢谢大家 散分~ 刚学devexpress 遇到个问题 如何用GridView控件来实现搜索功能 如何给DataList里面的模板绑定事件? 未能初始化 PassportManager 对象。请确保在服务器上正确安装了 Microsoft Passport。 急急```在Web开发中使用过图形报表的请进(真诚地邀请高手) datalist委托与方法问题 各位高人。请问如何获取CheckBoxList中被选中的数量 有关登陆和注册的问题 纳闷DataGrid PageIndexChanged事件不执行 页面和程序配合的问题 gridview不能及时刷新 求教!!try{}catch{}用法
string s = @"/PointForum/Forum/PostTopic.aspx";
Response.Write(Path.GetFileName(s));
alert(/[^\/]+(?=\/)/.exec(str));
var groups=/\/([^/?]+)$/.exec("/PointForum/Forum/PostTopic.aspx");
alert(groups[1]);
</script>
var folder=window.location.pathname;
var f=new Array();
f=folder.split("/");
alert("文件夹地址为:"+f[1]);
</script>我用这种搞定了 谢谢大家 散分~