all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Regular expressions and user-escaped characters
@ 2024-12-02 22:04 Christopher Howard
  2024-12-02 22:32 ` Joost Kremers
  2024-12-03 14:01 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 5+ messages in thread
From: Christopher Howard @ 2024-12-02 22:04 UTC (permalink / raw)
  To: Help Gnu Emacs Mailing List

Hi, what do you do in a regular expression if you want to match a character, but not a the same character that has been escaped by the user. E.g., if I want my regular expression to look for ?\[ (ASCII 91), matching string "[" and "a[a" but not string "\\[" or "a\\[a", if you follow me. Is this possible with just a regular expression?

If not, what is a good workaround? I was wondering about, say, replacing all the escaped characters first with some uncommon character (like a control code) and then converting back afterwards. But then I suppose I would need to do a check for that uncommon character first.

-- 
📛 Christopher Howard
🚀 gemini://gem.librehacker.com
🌐 http://gem.librehacker.com

בראשית ברא אלהים את השמים ואת הארץ



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-12-03 14:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02 22:04 Regular expressions and user-escaped characters Christopher Howard
2024-12-02 22:32 ` Joost Kremers
2024-12-02 22:50   ` Joost Kremers
2024-12-02 23:09     ` Joost Kremers
2024-12-03 14:01 ` Stefan Monnier via Users list for the GNU Emacs text editor

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.