摘要:
Javascript的正则分组不支持命名,只好自己搞了一个。先把命名存入数组,然后匹配。唉~~~有更好的解决方案么?代码:var route = '/{controller}/{action}/{id}', url = '/home/index/2';groupRE(route, url); // ==> {controller:'home', action:'index', id:'2'}/** @re: string, e.g.: '/{controller}/{action}/{id}'
阅读全文
posted @ 2011-03-16 16:02
Q.Lee.lulu
阅读(2603)
推荐(1)
编辑