Getting all URL parameters using regex
Possible Duplicate:
How can I get query string values?
Trying to get a regex (Javascript).
Input: url.html?id=14114&yolo=hahaha
Output: id=14114
yolo=hahaha
So this is what i have done so far: (&|?)(.*?)=(.*?)
How do I also include the red circled regions?
这种模式如何:
(?|&)([^=]+)=([^&]+)
[^&?]*?=[^&?]*
tested here
http://fiddle.re/bmdu
链接地址: http://www.djcxy.com/p/17604.html上一篇: Javascript正则表达式多重匹配
下一篇: 使用正则表达式获取所有URL参数