^ (anchor to start of string) Non-capturing Group / Capture Any word character or Any whitespace character or . zero-width negative lookahead aspx End Capture End Capture + (one or more times) Capture Capture /default.aspx End Capture ? (zero or one time) or Capture / ? (zero or one time) End Capture End Capture ? (zero or one time) End Capture $ (anchor to end of string)
Non-capturing Group
/
Capture
Any word character
or
Any whitespace character
or
.
zero-width negative lookahead
aspx
End Capture
End Capture
+ (one or more times)
Capture
Capture
/default.aspx
End Capture
? (zero or one time)
or
Capture
/
? (zero or one time)
End Capture
End Capture
? (zero or one time)
End Capture
$ (anchor to end of string)
http://www.regexlab.com/zh/regref.htm