HOW TO USE REGEX

john rob

Total Post:108

Points:756
Posted by  john rob
 1077  View(s)
Ratings:
Rate this:

I am using UrlRewriter.NET for urlrewriting...how do i write the regular expression for

http://localhost:2731/CitiZenJourNalism/ViewProfile.aspx?uid=3eb5bf69-1047-4936-9885-8ff41d45646f

in this format <rewrite url = "~/ViewProfile/([^/.]+)" to="~/ViewProfile.aspx?uid=$1" />

what should be the rewrite url for http://localhost:2731/CitiZenJourNalism/Reports.aspx?cat=local&id=6

Any help is appretiated.

  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: how to use regex

    Hi John, 


    try this:

    <rewrite url="~/Reports/(.+)/(.+)" to="~/Reports.aspx?cat=$1&amp;id=$2" />

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!