This Regex will match the following Relative URLs
REGEX
-----
^(/[a-zA-Z0-9]+)+(\.[a-zA-Z]{2,4})((\?\w*=?\w*)(\&\w+=\w+)*)?$
URLs
----
/folder1/page.ax
/folder1/page.php
/folder1/folder2/page.aspx
/folder1/page.aspx?qstring1=value1 (likewise n number of query strings)
Will not match
/folder1?/page.aspx
/folder1/page.aspx?=value1
/folder1/page.aspx?qstring1=value1?qstring2=value2
^(/[a-zA-Z0-9]+)+(\.[a-zA-Z]{2,4})((\?\w*=?\w*)(\&\w+=\w+)*)?$
Wednesday, March 4, 2009
Subscribe to:
Posts (Atom)