【发布时间】:2013-01-29 15:30:24
【问题描述】:
我有这个用于 url 重写的正则表达式:
<from>^/page/([0-9]+)/order/(.*)/by/(.*)/composition/(.*)/location/(.*)/price_min/(.*)/price_max/(.*)/industry/(.*)/type/(.*)$</from>
<to>/page=$1&order=$2&by=$3&composition=$4&location_id=$5&price_min=$6&price_max=$7&industry_id=$8&type_id=$9</to>
我想匹配如下 URL,但没有匹配。
/page/2/order/id/by/desc/composition/1/location/none/price_min/2/price_max/2/industry/2/type/3
【问题讨论】:
-
尝试用非贪婪的
.*?替换贪婪的.*
标签: java regex url-rewriting tuckey-urlrewrite-filter