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

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

Regular expressions and user-escaped characters


From: Christopher Howard
Subject: Regular expressions and user-escaped characters
Date: Mon, 02 Dec 2024 13:04:45 -0900

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

讘专讗砖讬转 讘专讗 讗诇讛讬诐 讗转 讛砖诪讬诐 讜讗转 讛讗专抓



reply via email to

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