---
title: "how to use regex"  
description: "how to use regex"  
author: "Anonymous User"  
published: 2014-09-02  
updated: 2014-09-03  
canonical: https://www.mindstick.com/forum/2241/how-to-use-regex  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# how to use regex

I am using UrlRewriter.NET for urlrewriting...how do i write the [regular expression](https://www.mindstick.com/articles/11909/java-regex-or-regular-expression-in-java) for

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

in this [format](https://www.mindstick.com/forum/162083/how-to-convert-ost-files-into-pst-format) <rewrite [url](https://www.mindstick.com/forum/436/url-redirection) = "~/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.

## Replies

### Reply by Sumit Kesarwani

Hi John, \

try this:

<rewrite url="~/Reports/(.+)/(.+)" to="~/Reports.aspx?cat=$1&amp;id=$2" />


---

Original Source: https://www.mindstick.com/forum/2241/how-to-use-regex

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
