The other day I was going through the article on URL rewriting and I saw this expression
<conditions>
<add input="{HTTP_HOST}" type=”Pattern” pattern="^([^.]+)\.mysite\.com$"> <!-- condition back-reference is captured here -->
</conditions>
I understand all except what does the expression ([^.]+) mean. I understand ^ means beginning and . means anything but what does the whole expression mean?
[^.]means “any character but a dot”. (In character classes, the^at the beginning means “not”.) The dot has no meaning inside a character class other than “a dot”.the
+means “one or more”.And the parentheses group the stuff inside them, and tell the regex engine to remember what it found there.
End result being, the whole expression would match something like “sub.mysite.com”, and the parenthesized part would match “sub” and remember it (presumably for future use).