From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Uwe Brauer Newsgroups: gmane.emacs.help Subject: Re: regexp problems the evil \[ Date: Fri, 24 Mar 2017 17:07:55 +0000 Message-ID: <87mvcawql0.fsf@mat.ucm.es> References: <87shm3fygf.fsf@mat.ucm.es> <87o9wrfxta.fsf@mat.ucm.es> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1490375552 21033 195.159.176.226 (24 Mar 2017 17:12:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 24 Mar 2017 17:12:32 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 24 18:12:28 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crSlH-00052N-2v for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Mar 2017 18:12:27 +0100 Original-Received: from localhost ([::1]:34179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crSlN-0003ow-3y for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Mar 2017 13:12:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crSjM-000383-7G for help-gnu-emacs@gnu.org; Fri, 24 Mar 2017 13:10:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1crSjH-0006z7-DS for help-gnu-emacs@gnu.org; Fri, 24 Mar 2017 13:10:28 -0400 Original-Received: from [195.159.176.226] (port=36584 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1crSjH-0006yv-7g for help-gnu-emacs@gnu.org; Fri, 24 Mar 2017 13:10:23 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1crSj0-0000le-0e for help-gnu-emacs@gnu.org; Fri, 24 Mar 2017 18:10:06 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 17 Original-X-Complaints-To: usenet@blaine.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:3zBUOEoXAzzBrRSlDVKVz8CcHd8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112651 Archived-At: >>> "Aurélien" == Aurélien Aptel writes: > On Thu, Mar 23, 2017 at 11:11 PM, Uwe Brauer wrote: >> Wow six \ I gave up after five. > Yes, it's ridiculous, I personally think emacs lisp regexes are > unusable once escapes are involved, especially interactively. > You can use rx instead of strings to make regexes from s-expressions. > Strings elements are always assumed to match literally (rx will always > escape whatever is needed to match the string literally). > (query-replace-regexp (rx "\\[" (group (+ (not (any "}")))) "\\]") ... Ah thanks did not know about it. Uwe