Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 快速正则表达式路由_Node.js_Regex_Express_Routes - Fatal编程技术网

Node.js 快速正则表达式路由

Node.js 快速正则表达式路由,node.js,regex,express,routes,Node.js,Regex,Express,Routes,我正在尝试设置一个正则表达式来处理通过Express的路线 我的get input具有以下表单: - site/?... - site/?P1=V1.... - site/?P1=V1&P2=V2.... 我试过: ^(\/)(\\?) ===> catch site/? ^(\/)(\\?)(P) ===> didn't catch site/?P 我使用: npm版本:5.0.3 快递:^4.15.3 我还在学习,所以如果它不应该像这样工作,请纠正

我正在尝试设置一个正则表达式来处理通过Express的路线

我的get input具有以下表单:

 - site/?...
 - site/?P1=V1....
 - site/?P1=V1&P2=V2....
我试过:

^(\/)(\\?)     ===> catch site/?
^(\/)(\\?)(P)  ===> didn't catch site/?P
我使用:

  • npm版本:5.0.3
  • 快递:^4.15.3
我还在学习,所以如果它不应该像这样工作,请纠正我:)
感谢您的帮助,peace:)

为什么需要在路由中指定查询参数?为什么需要在路由中指定查询参数?