From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Help improve regular expression for 24 hours format Date: Thu, 24 Nov 2022 13:32:42 +0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29719"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help GNU Emacs To: Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 24 07:33:32 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oy5nf-0007UY-VT for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 24 Nov 2022 07:33:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oy5n8-0001na-Lv; Thu, 24 Nov 2022 01:32:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oy5n7-0001jK-4j for help-gnu-emacs@gnu.org; Thu, 24 Nov 2022 01:32:57 -0500 Original-Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oy5n5-00010z-Js for help-gnu-emacs@gnu.org; Thu, 24 Nov 2022 01:32:56 -0500 Original-Received: by mail-wr1-x429.google.com with SMTP id cl5so992697wrb.9 for ; Wed, 23 Nov 2022 22:32:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=o/+7rW/DTLg273wfAI5Hkrp6ggfz4VRbKMLpmgzmhKQ=; b=Sagnnpovt71c7Ll6+L7zT78wVid1STMf8KARVgoscLavRsc5sdVS6WJ/v1laDGORqp WAwJgXrnoFSjbB6yYW/SlEuaKsInJy2aCuRJh1682NgxXmtbhAbeP2X9ZzAszm+B4RFP caGKwigb1K/x7KBgAvTyXLqnqM1UfrM/jnaUlDguy9gBaM80lKD+Im/mrjwUfTM9KkOf SWQ0o9wAxZZ2N2RNWkxtEJg9s/cC46OjOPjHiORYvW4kaOFfbdBd3waiy7jZh6on4WGO AFRHbyqNQsEHRyDdw2AE6vZvG+ijUTarxR96cSAwboi307q+JP1NX80btbY1qUlTGWEt vHtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o/+7rW/DTLg273wfAI5Hkrp6ggfz4VRbKMLpmgzmhKQ=; b=5yO+iMBvjXZHtKwbjZMd+LLQjYT2h+3EKg2sMg8r/5iGY7cYFSXo5N9x2XpBNTMUyh IWOlHm4UVCsY8oeSayXCms3QXbSbG4F+BPT+3mY6porlPXrG9zXykwPKNmgskSmXJawH 3ahhe8bFBzPwOUVb685Oq/dFHXTiHLf1VK+wz0H8lh6QKrWB3w84gnne1CiN6akSNQcL TlTu7SJQDFRIc4B6e7+KzHArsMWxeYin3z/6UBMBQJrMhkVc9t5OWbbjglYG69Ppd7fO CTf7rBUXLZda4caAaBh54dR3cn8w/7zZbe+4m7DcMvVTSPRsF0FdYrGOalPbvB/VktvJ /tRg== X-Gm-Message-State: ANoB5pmuOyRp4bbEHKsv1GSi5aa4iBu0GlU2lurh0PeB4QS/dYzky1J1 m8cr56GHABHkomDwpD4oWD7EA+15nJCUY0Cpawo= X-Google-Smtp-Source: AA0mqf5I2kfe70XgME1vGpjC4OznRpe6pXKIti1UyQWpuT7J7uPUfp4A+LDBLZkOLhINAiTJ+DBaW/Aq0wyCXIIXdQU= X-Received: by 2002:adf:b30f:0:b0:241:bfbe:81bc with SMTP id j15-20020adfb30f000000b00241bfbe81bcmr9584029wrd.603.1669271573771; Wed, 23 Nov 2022 22:32:53 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=yurivkhan@gmail.com; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141126 Archived-At: On Thu, 24 Nov 2022 at 10:38, Jean Louis wrote: > This regular expression shall match 24 hours format such as "12:34". > > I do not like how I wrote this regular expression, is there way to > provide to `rx' function something like "[012]"? I=E2=80=99d write it in classic regexp notation as \(?:\(?:[01][0-9]|2[0-3]\):\(?:[0-5][0-9]\)\) and probably leave like that as it=E2=80=99s readable enough as is. If you feel the need for rx here, then, as Tomas said, =E2=80=98any=E2=80= =99 (aka =E2=80=98in=E2=80=99 and =E2=80=98char=E2=80=99) with ranges is your friend. (Also I don=E2=80=99t understand your use of =E2=80=98(=3D 1 =E2=80=A6)=E2= =80=99. Looks redundant to me.)