1 |
On 1/21/19 5:02 PM, Michael Orlitzky wrote: |
2 |
> You need a parser, not a regular expression. |
3 |
|
4 |
The first thing that came to mind is splitting the values and passing |
5 |
them through printf. |
6 |
|
7 |
> (You can do it with a regex, but it's going to be one of those comical |
8 |
> twelve-page-long things.) |
9 |
|
10 |
I don't know about 12 pages. But, yes, a regular expression that takes |
11 |
all the possible cases into account, especially as the four octet IP, |
12 |
will be … complicated. A regular expression to work on an individual |
13 |
octet might be less complicated. |
14 |
|
15 |
You can play with REs fairly easily via sed. |