rgrep.1 -oP '\d+\.\d+\.\d+\.\d+(\/.\d+|)' file_with_ips
print lines matching a pattern
-o, --only-matching
       Print  only  the  matched  (non-empty) parts of a matching line, with each such part on a separate
       output line.
    -P, --perl-regexp
           Interpret PATTERN as a Perl regular expression (PCRE, see below).  This is highly experimental and
           grep -P may warn of unimplemented features.

Matching Control
    -e PATTERN, --regexp=PATTERN
           Use PATTERN as the pattern.  This can be used to specify multiple search patterns, or to protect a
           pattern beginning with a hyphen (-).  (-e is specified by POSIX.)
source manpages: rgrep