I have come across a regular expression that I don\'t fully understand - can somebody help me in deciphering it:
^home(?:\\/|\\/index\\.asp)?(?:\\?.+)?$ <
^home(?:\\/|\\/index\\.asp)?(?:\\?.+)?$
It's a non-capture group, which essentially is the same as using (...), but the content isn't retained (not available as a back reference).
(...)
If you're doing something like this: (abc)(?:123)(def) You'll get abc in $1 and def in $2, but 123 will only be matched.
(abc)(?:123)(def)
abc
$1
def
$2
123