On 1/21/19 5:02 PM, Michael Orlitzky wrote:
You need a parser, not a regular expression.

The first thing that came to mind is splitting the values and passing them through printf.

(You can do it with a regex, but it's going to be one of those comical twelve-page-long things.)

I don't know about 12 pages. But, yes, a regular expression that takes all the possible cases into account, especially as the four octet IP, will be … complicated. A regular expression to work on an individual octet might be less complicated.

You can play with REs fairly easily via sed.

Reply via email to