in reply to extracting variables from regex
Question is, Is there a way to get the values expanded from a quantifer?
No. But maybe variable interpolation helps:
Still, you shouldn't be using a regex for this. Consider using split:echo 123.45.67.890 | perl -ne'$ip = join ".", ("(\d{1,3})") x 4; /^$ip +$/; printf ...'
Btw: 123.45.67.890 is not a valid IP address ;) When you have come to your senses and thought of a valid IP, think about using unpack.echo 123.45.67.890 | perl -ne'printf "%X%X%X%X\n", split /[\.\s]/'
U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk
|
|---|