RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Match Default Document + Optional Querystring
Expression
^~/(?:default\.aspx)?(?:\?=.*)?$
Description
Designed for asp.net default document matching. It allows either a plain url (~/) or a default document url (~/default.aspx) both with an optional querystring. Cassini and IIS7 handle default document matching differently. The user could type it either way. The breadcrumb / sitemap system is funny about omitting default.aspx. Note: Doesn't handle #fragements
Matches
/default.aspx | /default.aspx?query=string | / | /?query=string
Non-Matches
/default.aspx#fragment | /default.aspx?query=string#fragment | /#fragment | /?query=string#fragment
Author Rating: Not yet rated. Matthew Harris
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2014, RegexAdvice.com | ASP.NET Tutorials