Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6sPL-0002b9-Jk for pgsql-docs@arkaria.postgresql.org; Tue, 02 Feb 2021 09:55:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l6sOn-00088J-Cl for pgsql-docs@arkaria.postgresql.org; Tue, 02 Feb 2021 09:55:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6sOn-00088B-62 for pgsql-docs@lists.postgresql.org; Tue, 02 Feb 2021 09:55:05 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l6sOj-00061g-Tc for pgsql-docs@lists.postgresql.org; Tue, 02 Feb 2021 09:55:03 +0000 Received: by mail-wm1-x32e.google.com with SMTP id w4so493627wmi.4 for ; Tue, 02 Feb 2021 01:55:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=grFDnIPdm8LBHjREFBKRuPmG+TluiUCM5z+7JnJmEP0=; b=t6KoF7EnJID0cJ5cTbrqQX9yQYBoNUyTd1GEyOPqo80RaJ+OHAjTh8fMaM4BEC5WNV e5lqE8VOD41I/aE29uikkQVgxc8q1mYO65I7X6K4K8k7NEmQE2Qoe3lUf5cLTWhRst3n YNj1fHJfqJ5SlKl9jBTQOwSyInhFwPEwvCQl3rfoZNiqIay0HUG+GJNIFkTPVh50eXZ5 gl4uXP+NOIbTdO0NXOZhFT3KY02Xdqnu4BCzqhM1DyvvZjBOvyL8s23I9HzvR42YybQC X9EGIlGZbwHPAepAkmEpZ/ZvxadnbBR5NCbFqEXoBFjB+DwVP3g4PfZgfnqplER7jhwo LPig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=grFDnIPdm8LBHjREFBKRuPmG+TluiUCM5z+7JnJmEP0=; b=P0nJM6g1waqy2Y+Ctltq9syDmGNzOWnwZw6YRlqXAlBqQnVU1SJK775Y4/7ouaWo/p gqhnbr1WzQx0HzQFYaJmLofbYwwnk+Yg1fbfbVtpEi7EAZvC2Auh67f5nuQDNLW4ayVo b6VNyB2AKMSrlV8FOpynfH5lTuIXavVYe5HbgIXCHQiJfXzxkiaLmLRED2AWz34xpRAH emsv4/oHH5t3CyGVPjuzarCEkirZw4ADuuiAe4wigboZ6+s7jygU0vjcUeOqS/2iXEMN TNW5w4kVuxgqDdlYErl/AB8rXbBcJLfSQSiGk/YFeI2P44Dt8rtYIwj9LmEcxTiebTU5 n84Q== X-Gm-Message-State: AOAM530o5eVpLgi0dr6f0Qwk9yoEbDfcOfq5oUaHA2l85Tjr5WydeXT2 SXL4QG/JfqS7bTiirK+4fq1VWA== X-Google-Smtp-Source: ABdhPJyY2GSp/ahRVo4OWpj3Nu7bc8cqsCI9bGrWftZs1UOdgE07nRikgHBzhmJCqoPMEHey9mLwzA== X-Received: by 2002:a05:600c:4ec7:: with SMTP id g7mr1548965wmq.56.1612259700182; Tue, 02 Feb 2021 01:55:00 -0800 (PST) Received: from localhost.localdomain (217-149-170-38.nat.highway.telekom.at. [217.149.170.38]) by smtp.gmail.com with ESMTPSA id p12sm2076188wmq.1.2021.02.02.01.54.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 01:54:59 -0800 (PST) Message-ID: Subject: Re: Unnecessary use of .* in examples From: Laurenz Albe To: Tom Lane Cc: rmzgrimes@gmail.com, pgsql-docs@lists.postgresql.org Date: Tue, 02 Feb 2021 10:54:58 +0100 In-Reply-To: <3335696.1612192132@sss.pgh.pa.us> References: <161215841824.14653.8969016349304314299@wrigleys.postgresql.org> <259a5d19b504d7cb9bb2f76ea384a045bcc525dc.camel@cybertec.at> <3335696.1612192132@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, 2021-02-01 at 10:08 -0500, Tom Lane wrote: > > On Mon, 2021-02-01 at 05:46 +0000, PG Doc comments form wrote: > > > In the table for the ~ (and friends) operator, every example has a pointless > > > set of '.*' surrounding the text to be matched. These unnecessary operators > > > add visual clutter making the examples both harder to read and understand, > > > and since they're official examples, they teach bad habits. > > > I agree that that is comewhat confusing for people who understand > > regular expressions. On the other hand, the example should show some > > special characters, so that people who don't know regular expressions > > understand that this is more than substring matching. > > > Perhaps 'thomas' ~ '^thom' and so on? > > There are examples just a bit further down that include special > characters. I agree with the OP that the useless ".*"s add nothing > except confusion as to the semantics; but I don't think we need these > very first examples to use a lot of bells and whistles. > > Maybe what would be better is to have an example with embedded .* > such as 'thomas' ~ 't.*m'. I agree, and thanks for improving it in https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9522085ac917af66dba29939af328ae67300f10a Yours, Laurenz Albe