Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

starting my answer based on this answer:

Yes , You have lot of options/tools to use. I just tried this , it works:

ifconfig | grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" a so you can use grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" to grep the ip addresses from your output.

and converting the answer to full length IPv6, etc...:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}\b" -- file

if you want to keep the /nnn if it's there:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}(/[0-9]{1,3}){0,1}\b" -- file

and also there's the shortened version of IPv6 that includes '::'.

for more IPv6 answers you can look here: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresseshttps://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses

starting my answer based on this answer:

Yes , You have lot of options/tools to use. I just tried this , it works:

ifconfig | grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" a so you can use grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" to grep the ip addresses from your output.

and converting the answer to full length IPv6, etc...:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}\b" -- file

if you want to keep the /nnn if it's there:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}(/[0-9]{1,3}){0,1}\b" -- file

and also there's the shortened version of IPv6 that includes '::'.

for more IPv6 answers you can look here: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses

starting my answer based on this answer:

Yes , You have lot of options/tools to use. I just tried this , it works:

ifconfig | grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" a so you can use grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" to grep the ip addresses from your output.

and converting the answer to full length IPv6, etc...:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}\b" -- file

if you want to keep the /nnn if it's there:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}(/[0-9]{1,3}){0,1}\b" -- file

and also there's the shortened version of IPv6 that includes '::'.

for more IPv6 answers you can look here: https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses

changed last set of sentences to make since, and added the word 'and'
Source Link

starting my answer based on this answer:

Yes , You have lot of options/tools to use. I just tried this , it works:

ifconfig | grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" a so you can use grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" to grep the ip addresses from your output.

and converting the answer to full length IPv6, etc...:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}\b" -- file

if you want to keep the /nnn if it's there:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}(/[0-9]{1,3}){0,1}\b" -- file

and also there's the shortened version of IPv6 that includes '::'.
For

for more IPv6 answers you can look here: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses

starting my answer based on this answer:

Yes , You have lot of options/tools to use. I just tried this , it works:

ifconfig | grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" a so you can use grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" to grep the ip addresses from your output.

and converting the answer to full length IPv6, etc...:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}\b" -- file

if you want to keep the /nnn if it's there

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}(/[0-9]{1,3}){0,1}\b" -- file

and also there's the shortened version of IPv6 that includes '::'.
For more IPv6 answers you can look here: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses

starting my answer based on this answer:

Yes , You have lot of options/tools to use. I just tried this , it works:

ifconfig | grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" a so you can use grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" to grep the ip addresses from your output.

and converting the answer to full length IPv6, etc...:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}\b" -- file

if you want to keep the /nnn if it's there:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}(/[0-9]{1,3}){0,1}\b" -- file

and also there's the shortened version of IPv6 that includes '::'.

for more IPv6 answers you can look here: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses

changed last set of sentences to make since, and added the word 'and'
Source Link

starting my answer based on this answer:

Yes , You have lot of options/tools to use. I just tried this , it works:

ifconfig | grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" a so you can use grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" to grep the ip addresses from your output.

and converting the answer to full length IPv6, etc...:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}\b" -- file

if you want to keep the /nnn if it's there

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}(/[0-9]{1,3}){0,1}\b" -- file

and also there's the shortened version of IPv6 that includes '::'.
forFor more IPv6 answers to that you couldcan look here for more: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses

starting my answer based on this answer:

Yes , You have lot of options/tools to use. I just tried this , it works:

ifconfig | grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" a so you can use grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" to grep the ip addresses from your output.

converting the answer to full length IPv6, etc...:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}\b" -- file

if you want to keep the /nnn if it's there

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}(/[0-9]{1,3}){0,1}\b" -- file

and also there's the shortened version of IPv6 that includes '::' for answers to that you could look here for more: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses

starting my answer based on this answer:

Yes , You have lot of options/tools to use. I just tried this , it works:

ifconfig | grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" a so you can use grep -oE "\b([0-9]{1,3}.){3}[0-9]{1,3}\b" to grep the ip addresses from your output.

and converting the answer to full length IPv6, etc...:

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}\b" -- file

if you want to keep the /nnn if it's there

fgrep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}(/[0-9]{1,3}){0,1}\b" -- file

and also there's the shortened version of IPv6 that includes '::'.
For more IPv6 answers you can look here: http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses

Source Link
Loading