>_ IzzyLab

Topic breakdown

Unlike the "cut out the match" mode, a plain grep prints the whole line when at least one match of the pattern is found inside it — which is exactly what's needed to filter logs by the presence of an IP. A simplified IPv4 pattern is four groups of digits separated by dots; the dot between groups must be escaped, otherwise it means "any character". Strict validation of the 0–255 range is excessive here: an approximate "digits-dot-digits..." is enough, while precise octet validation via alternation of ranges is the subject of a harder task.

What's checked

  1. All lines with an IP found
  2. Lines without an IP filtered out

What it looks like