The groups are defined by “protocol” and “port” and are referred to in the Result method. The result method is used to reformat the extracted groups, i.e the substrings. In this case we just concatenate them. Calling this method with the URL in above yields “http:8080”.

Your daily tips are highly appreciated. I personally use Regexes a lot. However, most people hate them because they tend to become hard to read. In such cases, using the `RegexOptions.IgnorePatternWhitespace` option might help. The above method could be reformatted like this: