>_ IzzyLab

Topic breakdown

This task is about extracting the part of a string between known boundaries: you need to cut off the scheme (http:///https://) and the path, leaving the host. One approach is a substitution in sed -E: capture the host in a group and replace everything else with its contents. The host is described by the negated class [^/]+, which greedily takes everything up to the first slash of the path. The optionality of the letter s in the scheme is set by the ? quantifier. The alternative is grep's PCRE mode with a lookbehind (?<=://), which doesn't include the separator in the result and does without a capture group.

What's checked

  1. Domains extracted
  2. Scheme removed
  3. Path removed

What it looks like