From christian at echoffmann.ch Tue Jul 6 11:47:41 2021 From: christian at echoffmann.ch (Christian) Date: Tue, 6 Jul 2021 17:47:41 +0200 Subject: [OS X Emacs] How to search for regex \{ | \} In-Reply-To: References: Message-ID: <7db0cbb7-eed2-337a-0f3e-5c333fdca8d0@echoffmann.ch> Hi, To check for properly paired { and } I'd like to do an incremental search for both { and }, "{ | }", i.e. '{' or '}'. ^s { followed by | } terminates the search with "Keyboard macro terminated by a command ringing the bell". This is not what I want. Q: How do I do that search (incrementally) ? -- Christian Hoffmann Rigiblickstrasse 15b CH-8915 Hausen am Albis Switzerland Telefon +41-(0)44-7640853 From Peter_Dyballa at Web.DE Tue Jul 6 12:28:00 2021 From: Peter_Dyballa at Web.DE (Peter Dyballa) Date: Tue, 6 Jul 2021 18:28:00 +0200 Subject: [OS X Emacs] How to search for regex \{ | \} In-Reply-To: <7db0cbb7-eed2-337a-0f3e-5c333fdca8d0@echoffmann.ch> References: <7db0cbb7-eed2-337a-0f3e-5c333fdca8d0@echoffmann.ch> Message-ID: > Am 6.7.2021 um 17:47 schrieb Christian : > > Q: How do I do that search (incrementally) ? Very good question! I'd try with M-C-s or isearch-forward-regexp. For example like that: ESC C-s [ { | } ] RET This would regular expression (almost) incrementally search for characters in the set ('[' ? ']') of characters '{' or '|' or '}'. You can search for the next character from this set with C-s (or C-r backwards). To re-search you can invoke ESC C-s C-s (or C-r). -- Mit friedvollen Gr??en Pete Mushrooms always grow in damp places, which is why they look like umbrellas. From Peter_Dyballa at Web.DE Tue Jul 6 12:37:16 2021 From: Peter_Dyballa at Web.DE (Peter Dyballa) Date: Tue, 6 Jul 2021 18:37:16 +0200 Subject: [OS X Emacs] How to search for regex \{ | \} In-Reply-To: <7db0cbb7-eed2-337a-0f3e-5c333fdca8d0@echoffmann.ch> References: <7db0cbb7-eed2-337a-0f3e-5c333fdca8d0@echoffmann.ch> Message-ID: > Am 6.7.2021 um 17:47 schrieb Christian : > > Q: How do I do that search (incrementally) ? Correction! You want to find any { or } and some text in between, right? Then it would be: ESC C-s { . * } and would high-light "{what ever}". This is a simplistic approach which would find {some command argument \othercommand{its argument} maybe some more}". Backward it would be "{its argument} maybe some more}"! -- Mit friedvollen Gr??en Pete Journalism is printing what someone else does not want printed; everything else is public relations. ? George Orwell