Gentoo Archives: gentoo-user

From: Michael Orlitzky <mjo@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: OT scripting - strip zero if between period and digit
Date: Fri, 25 Jan 2019 17:32:26
Message-Id: 77c654fd-7a9d-c81d-bcd9-b20d9d6c5072@gentoo.org
In Reply to: Re: [gentoo-user] Re: OT scripting - strip zero if between period and digit by Kai Peter
1 On 1/25/19 11:32 AM, Kai Peter wrote:
2 >
3 > Really interesting _how_ people think. Find the error:
4 >
5
6 You're not even trying:
7
8 $ echo 0.0.0.0 | sed 's/\.0/\./g' | sed 's/^0//g' | \
9 sed 's/\.0/\./g' | sed 's/\.\./.0./g' | sed 's/^0//g'
10 .0..
11
12 It's trivial to enumerate all "valid" (that is, without leading zeros)
13 IP addresses. The most basic test that any regex should pass is that it
14 should do nothing on those examples.

Replies

Subject Author
Re: [gentoo-user] Re: OT scripting - strip zero if between period and digit Kai Peter <kp@×××××××××××××××.org>