1 |
> |
2 |
> > François-Xavier |
3 |
> > |
4 |
> > |
5 |
> |
6 |
> My bad, it should be: |
7 |
> |
8 |
> sed 's/0*\([0-9][0-9]*\)/\1/g' |
9 |
> |
10 |
> (tests are indeed needed!) |
11 |
> |
12 |
|
13 |
Many thanks François. This is almost right, but it is also stripping zeros |
14 |
that follow a letter, and I only want it to strip zeros that are proceeded |
15 |
by a period. There are no leading zeros in the first octet of the IP so |
16 |
that case does not need to be handled. |
17 |
|
18 |
Does the \1 refer to what's in the ()'s? So anything that one would wont to |
19 |
carry through should be inside the ()'s and anything that's outside is |
20 |
stripped, right? |