Frankly speaking - I don't know why would one do such a thing using a Regular expression.
Your problem seems to be something else. If you have absolute url's like the following,
a) test.Abc.com/chennai-adyar
b) test.Abc.com/chennai-adyar_3
And depending on the values after the domain, you need to route to a controller or something of that sort , that gives you the required data based on the url parameter.
I presume you are using ASP.Net, and if you are using v4.0, you can leverage the concept of Routing.
You would do this in register routes method in global.asax.cs
public static void RegisterRoutes(RouteCollection routes)
{
routes.Clear();
// Turns off the unnecessary file exists check
routes.RouteExistingFiles = true;
//axd, sitemap
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//ignore favicon requests from modern browsers.
routes.IgnoreRoute("favicon.ico");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
//Ignore css
routes.IgnoreRoute("{resource}.css/{*pathInfo}");
//Ignore js
routes.IgnoreRoute("{resource}.js/{*pathInfo}");
//Ignore Content folder
routes.IgnoreRoute("{folder}/{*pathInfo}", new { folder = "content" });
//ignore all aspx routes.
routes.IgnoreRoute("{*allaspx}", new { allaspx = @".*\.aspx(/.*)?" });
//ignore all png requests.
routes.IgnoreRoute("{*allpng}", new { allpng = @".*\.png(/.*)?" });
routes.MapRoute(
"allOtherRoutes",
"{*url}",
new { controller = "page", action = "render", id = "" }
);
}
According to this example, you would use the page controller's render Action method to render the view accordingly to your page number. You would use the id parameter at the end, that would let you render the view accordingly.
Hope this helps.