簡體   English   中英

將URL轉換為正則表達式

[英]Convert URLs into Regular Expression

我在asp.net中使用Intelligencia.UrlRewriter.dll進行URL重寫,但是我不知道正則表達式。 有沒有人可以幫助我將這些網址轉換為正則表達式。

http://localhost:50788/catalog.aspx?VendorID=1&CategoryID=1

供應商ID以及類別ID均可更改。

http://localhost:50788/Product.aspx?ProductID=1

同樣,可以更改ProductID。 我實際上想在web.confg文件中為這些查詢字符串編寫正則表達式,例如

<!-- Rewrite department pages -->
    <rewrite url="/Index" to="~/Default.aspx" />

最后,還有什么最好的URL重寫器?

正如其他人指出的那樣,您的問題尚不清楚。 這是您要做什么?

new Regex(@"http://localhost:50788/catalog\.aspx\?VendorID=\d+&CategoryID=\d+");

new Regex(@"http://localhost:50788/Product\.aspx\?ProductID=\d+");

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM