all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eduardo Ochs <eduardoochs@gmail.com>
To: angelomolina@tutanota.com
Cc: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: Re: Making a regex string that matches (
Date: Fri, 11 Mar 2022 20:43:45 -0300	[thread overview]
Message-ID: <CADs++6iRvkTTk9doc4XWqv3XFZxs-atDFaJTNE9mEUTFi47iBQ@mail.gmail.com> (raw)
In-Reply-To: <Mxo1pEJ--3-2@tutanota.com>

On Thu, 10 Mar 2022 at 11:31, angelomolina--- via Users list for the
GNU Emacs text editor <help-gnu-emacs@gnu.org> 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 <help-gnu-emacs@gnu.org> 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



      parent reply	other threads:[~2022-03-11 23:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 13:36 Making a regex string that matches ( angelomolina--- via Users list for the GNU Emacs text editor
2022-03-10 14:39 ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-03-10 15:51   ` Robert Pluim
2022-03-10 17:14     ` goncholden
2022-03-10 17:48       ` Eric Abrahamsen
2022-03-10 17:57       ` [External] : " Drew Adams
2022-03-10 18:54         ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-03-10 18:03       ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-03-11 12:24       ` Leo Butler
2022-03-11 19:53         ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-03-10 15:13 ` Leo Butler
2022-03-11 23:43 ` Eduardo Ochs [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADs++6iRvkTTk9doc4XWqv3XFZxs-atDFaJTNE9mEUTFi47iBQ@mail.gmail.com \
    --to=eduardoochs@gmail.com \
    --cc=angelomolina@tutanota.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.