I am just starting out using sed and I intend to use it to extract IP addresses from ping output. Here's what I am trying to achieve exactly:input text:  ytmti (192.188.2.3) jjggydesired output:  192.188.2.3command I am trying:  echo ytmti (192.188.2.3) jjggy | sed 's:\((\(192.188.2.3\))\):\2:' current output:  ytmti 192.188.2.3 jjggyNote: ytmti and jjggy are really stand-ins for text like Pinging unix.stackexchange.com and with 32 bytes of data:.I think using awk might be a better solution for parsing ping output,but I would like to get accustomed to sed.
Extracting text using sed does not work as expected
sed;awk
The substitution command of sed replaces all characters matched in first section with all character of second section, so you will need .* or similar and group only the part to save, like:echo  ytmti (192.188.2.3) jjggy | sed 's:^.*(\([^)]*\).*$:\1:'Note that I use [^)]* that avoids to hardcode the IP and generalize it for any of them. It yields:192.188.2.3