help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Get boundaries of the string at point matching a regular expression


From: Rodrigo Morales
Subject: Get boundaries of the string at point matching a regular expression
Date: Thu, 18 Nov 2021 14:58:19 -0500

I know that org-in-regexp can be used to check that the point is inside
a given regular expression (see minimal working example below). However,
this has the huge dependency of Org Mode.

#+BEGIN_SRC elisp
(with-temp-buffer
  (insert "fooooooooo bar")
  (goto-char 1)
  (org-in-regexp "fo+"))
#+END_SRC

#+RESULTS:
#+begin_example
(1 . 11)
#+end_example

I'm now wondering whether there's a function bundled with Emacs that
doesn't depend in Org Mode that would do the same of org-in-regexp. I
was thinking in copying the definition of org-in-regexp, but I would
like to first ask for other approaches.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]