From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from minnie.tuhs.org (minnie.tuhs.org [IPv6:2600:3c01:e000:146::1]) by inbox.vuxu.org (Postfix) with ESMTP id 11BBE240AC for ; Mon, 4 Mar 2024 15:25:15 +0100 (CET) Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 1BD43436C3; Tue, 5 Mar 2024 00:25:11 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuhs.org; s=dkim; t=1709562311; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-owner:list-unsubscribe: list-subscribe:list-post; bh=m6r2In9WZOX+OyjZgtw0JX4RDE6ACa5F7d3/Q7Vsqhk=; b=cWL83J9DiF6BG+Xn3xeqyh5SjElCRt1rCxiwVBMLLuU/DcBtG3mnV1T/HHILUkWZJ1nDuU 70jCUIjB00tdHyFmztQSlccBASFY4ZxEZeZHM9/LD+h3yNpGXFe5RVBvCr5OsvrZK8S+Iu PhDWRIoWktlKSjcaag6/QNH3HBT1SN8= Received: from panix.netmeister.org (panix.netmeister.org [166.84.7.99]) by minnie.tuhs.org (Postfix) with ESMTPS id C6D3E436BC for ; Tue, 5 Mar 2024 00:25:02 +1000 (AEST) Received: by panix.netmeister.org (Postfix, from userid 1000) id 797AE86008; Mon, 4 Mar 2024 09:25:00 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=netmeister.org; s=2024; t=1709562300; bh=1aRmfM3dNY7QvYbfm8NSvX66uSuKkfOA3FmhpBjHMF4=; h=From:To:Subject:Content-Type:From:To:Subject; b=ixYvaFm1M7jB3PgWvPlW4N+LfM+9q2hUC6CVaXOcaduh3F2ez4Bi4a2jSmxUbusK6 XuoGCQVsZQTjqGWDbWSuW/b0Yt+SkSTQij8gpV2qE/5uH5hOr3YPmOIpNOHIU/6Ohf XsPyIUGGbmDFmqbDZr5ZxsU4LHLvY9JyRJAh+0hM= Date: Mon, 4 Mar 2024 09:25:00 -0500 To: Alec Muffett Message-ID: Mail-Followup-To: Alec Muffett , Rob Pike , Marc Rochkind , Will Senn , TUHS References: <13abd764-984a-4c9f-8e3e-b1eb7c624692@gmail.com> <20240304033845.GB5304@mcvoy.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Message-ID-Hash: GVMIFXUIERPFV37OUXB2ML2Z5QZR4BCI X-Message-ID-Hash: GVMIFXUIERPFV37OUXB2ML2Z5QZR4BCI X-MailFrom: jschauma@netmeister.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Marc Rochkind , Will Senn , TUHS X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: regex early discussions List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Jan Schaumann via TUHS Reply-To: Jan Schaumann Alec Muffett wrote: > I once got into a bunfight with a Googler on the topic of coding interview > questions, on a related matter. He was promulgating a regular expression to > correctly match/parse-out legitimate dotted-quad IPv4 addresses That seems an excellent illustration of "now they have two problems." (And now do IPv6.) If you need to pull IP addresses from text, the most liberal regex will generally be "good enough"; if you must be certain, feed the string to inet_aton(3). :-) -Jan