I am trying to match an IPv6 address with square brackets but I am surprisingly stuck...
Works:
echo 'files ([2001:450:671d:200::121]:59464).' | egrep 'files \(.+\)\.$'
Does NOT match (but I think a dot in a character class is valid):
echo 'files ([2001:450:671d:200::121]:59464).' | egrep 'files \([.]+\)\.$'
Any other attempt such as
echo 'files ([2001:450:671d:200::121]:59464).' | egrep 'files \([][0-9:]+\)\.$'
echo 'files ([2001:450:671d:200::121]:59464).' | egrep 'files \([[]0-9:]+\)\.$'
echo 'files ([2001:450:671d:200::121]:59464).' | egrep 'files \([]0-9:[]+\)\.$'
echo 'files ([2001:450:671d:200::121]:59464).' | egrep 'files \([\[\]0-9:]+\)\.$'
Does not work either...
What the heck is wrong here?