From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Re: Making a regex string that matches ( Date: Fri, 11 Mar 2022 20:43:45 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6082"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: angelomolina@tutanota.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 12 00:44:27 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 1nSovq-0001P7-Pq for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 12 Mar 2022 00:44:26 +0100 Original-Received: from localhost ([::1]:34350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSovp-0003NX-6n for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 11 Mar 2022 18:44:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSovS-0003NJ-L8 for help-gnu-emacs@gnu.org; Fri, 11 Mar 2022 18:44:02 -0500 Original-Received: from [2a00:1450:4864:20::133] (port=35564 helo=mail-lf1-x133.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nSovP-0004dH-KL for help-gnu-emacs@gnu.org; Fri, 11 Mar 2022 18:44:02 -0500 Original-Received: by mail-lf1-x133.google.com with SMTP id g17so17706531lfh.2 for ; Fri, 11 Mar 2022 15:43:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4tkkycb3+rWHkevTr2gB8c9pbAZeSbdxhoK9kOox74s=; b=bQuZmYeyI98kM5LXQLz6drcieUofSZzh3y4rB37xs4vxfyYyUq2UR35wnhUM+3t9Vy U+p3GzCwoa1XFfXuqp0y60qoE3ov6BJAn7HSTD2qTFkgBt/wL4VauW+SAsNGZSyBiq0o 2dM+bzsmKR6NJpW7cvPtor2MGdyOZnzit/6ooIqa1XRu7JumXbM18xsKFxvFWUIloEr0 crs6GB1lXRPSq0zNYiFBnQ5ePt3lkIrzZVDS3wsNX0S7PhWtBsTmAkV70rk+fbQarliL Op7iTMy5gJsqFZL0dk6vj4ARt+8wYo2Xf+txn1317HQe5h6OMtuD2m/605ajZPJ775Jh ZO1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4tkkycb3+rWHkevTr2gB8c9pbAZeSbdxhoK9kOox74s=; b=ySqeU/+IBsg0t3xwbljwBhGpPLGXesN/x7wagHk1QwN1yys8venSxMuh/TirRpT1Ua TztOO6YGpXN87pee5Sioapl834H379BRvOxYKpUwTT9VjfdA3OzppTtnRJRHh3dRWxcp Y/M+gyZvRkyLX/52hWvfa2t2on2kDPaZjvhuKkE1IaeO3xniszvci45MSoL2rN3Fqjq7 RjHrcCzO28avc1XJyXA1d4I/TMCu2jwxxpev+2pqiTejL+bGHcGSN1mwXuXM/b+gkW4R E8XXWKg7l2hc3aqrSPZufOEdv+jutFnp/qMSGH3Phl1YegjovONO1nWM+Schv8jgU22/ 3+pQ== X-Gm-Message-State: AOAM531AFIN1V7TkjYyasH50OHnrBzuM5e0wWHq72RJOFm+SlL22Dwk6 v/7J65XRwTBdxTMzgiq6UBARjz+Ghm1+mGJU9PE= X-Google-Smtp-Source: ABdhPJxxYYy2N/s8+3levaydEsK/BJk1qyuroKRUSSMslZJzkSVigPPQR5P00DIn09cYtkbke5uh+VeiT16mIbLSZ7M= X-Received: by 2002:a19:655d:0:b0:448:2caa:7eb3 with SMTP id c29-20020a19655d000000b004482caa7eb3mr7190512lfj.572.1647042237163; Fri, 11 Mar 2022 15:43:57 -0800 (PST) In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::133 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=eduardoochs@gmail.com; helo=mail-lf1-x133.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" Xref: news.gmane.io gmane.emacs.help:136460 Archived-At: On Thu, 10 Mar 2022 at 11:31, angelomolina--- via Users list for the GNU Emacs text editor wrote: > > How can I make a regex string if I want to search for (. On Thu, 10 Mar 2022 at 11:31, angelomolina--- via Users list for the GNU Emacs text editor wrote: > > How can I make a regex string if I want to search for (. Hi Angelo, Slightly off-topic, but I learned a lot about obscure-ish regexp tricks by using rx and xr to convert regexps to the rx notation and back... see: (info "(elisp)Rx Notation") https://github.com/mattiase/xr Try: (rx "/*" (zero-or-more (or (not (any "*")) (seq "*" (not (any "/"))))) (one-or-more "*") "/") (xr "/\\*\\(?:[^*]\\|\\*[^/]\\)*\\*+/") (xr find-function-regexp) Here are some examples of things that I didn't know how to write in regexp syntax, and that I only discovered using rx: (rx (any "[]")) (rx (any "")) (rx (not (any ""))) Now let's wait for Emanuel Berg's reaction... =) Cheers, Eduardo Ochs http://angg.twu.net/#eev