I would like to replace this pipeline of three commands with one. I think that it is possible to achieve a similar result with only awk or sed.
Current solution with cat, greep and awk
cat textfile | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}(\/[0-9]{1,2}|)" | awk '{print "prefix "$0}'
Text file example:
192.168.1.1 10.100.20.0/24 some text 2a05:d014:d13:26aa:f493:ef87:bb60:d85f
10.15.12.11, text "10.10.0.0/16" =25.0.0.0/12 etc
Output:
prefix 192.168.1.1
prefix 10.100.20.0/24
prefix 10.15.12.11
prefix 10.10.0.0/16
prefix 25.0.0.0/12