From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Douglas Lewan Newsgroups: gmane.emacs.help Subject: Re: Regular expression grouping not working? Date: Sat, 8 Feb 2020 14:48:26 -0500 Message-ID: <839ed1f6-9c0e-f6c7-082b-8398c5861de9@gmail.com> References: <02a28c91-d67d-e76a-c2a7-41b82d6b023f@gmail.com> <871rr4op14.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="53667"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 To: Teemu Likonen , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 08 20:49:00 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j0W67-000DqA-R2 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 08 Feb 2020 20:48:59 +0100 Original-Received: from localhost ([::1]:44832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0W66-00039J-Tp for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 08 Feb 2020 14:48:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55728) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0W5k-00038w-9M for help-gnu-emacs@gnu.org; Sat, 08 Feb 2020 14:48:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j0W5j-0002jj-9s for help-gnu-emacs@gnu.org; Sat, 08 Feb 2020 14:48:36 -0500 Original-Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:39425) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j0W5j-0002dW-2y for help-gnu-emacs@gnu.org; Sat, 08 Feb 2020 14:48:35 -0500 Original-Received: by mail-qk1-x732.google.com with SMTP id w15so2654320qkf.6 for ; Sat, 08 Feb 2020 11:48:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=pAk8M6dhk7Blau+0R1Vh0aelAAdMlvHKeTONLXIxL9E=; b=OxRFQUYjeC7s2Nt2D+3KzMtqHD396X0P9biL+Y1gCQcypyjJi7UNmwkl3PeGxPyNdc GqWiD+pRuIdPaUZwzwOwzRf+JNhr+pScq5wDzzUgJ7wDda+FKQgSKWrtoHoCKz/o2mqt osRMgi+bW/V1HeVgs3cESyqYrpFVbSjkCm3FqPT0XX5MqwAzF+ymF51kgdJQHvH6KSk2 l9vF87qGmgDt2vXnHK7gA6VdheZ9VP4nOI6Ua1oi/vO2FcJCiuTCELOw0UsfSr3QgsIa elt0KvSB5Z0Ej+DL7SnIiG8HNHWYwIKfDMJYo22IBu0RYybvStfkWRmDVNYd2oqTwQR+ b8mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=pAk8M6dhk7Blau+0R1Vh0aelAAdMlvHKeTONLXIxL9E=; b=JciPdf4y7m+p6i9Qw8nRSwG0wkQdnExuv7zZZrnDbjeonrMYpmuU/q3o+jG+rn/kby YjUBJo9YImizfhHTpvpmt5AtBBGwdd23ChM79gBhbxrrtcBCBesrt/CtL+iMN6wupDD8 8DMzubvguDF7z2KYko0aVAdscio9m32kO3pJrKbJz3fQwK/4cOvKkQiO3rNn/xxhX+qj KHWLZttl0Zt60Z6Nh/mbGgnoXlVNxBRBXnj7t95IkP4RKvKcrZgj3k4cdUBEdm2XSwVN lKVuXBHk1UcsFBE8L6aGsf4qQ/eUOmhH9ua0EoZvusi/Z66jANXiMpIxfkIM6zC7Q43g dK5A== X-Gm-Message-State: APjAAAWFMSmUtz6L9TBmu5GW8Jes61J/fzS36KTYcRMrrawtKO5PWbZY j1WHjgl1CFODumcLGTav95ug+vM= X-Google-Smtp-Source: APXvYqw8BzB21Rm2WOjPt+8q4hoSxNfiyj3LHIVdNVirGS5qSSLEuEy1M4PsZQdb1XYqV2Z64TAatw== X-Received: by 2002:ae9:ed10:: with SMTP id c16mr4342169qkg.95.1581191314238; Sat, 08 Feb 2020 11:48:34 -0800 (PST) Original-Received: from [0.0.0.0] ([23.129.64.224]) by smtp.gmail.com with ESMTPSA id f28sm3238612qkk.130.2020.02.08.11.48.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Feb 2020 11:48:33 -0800 (PST) In-Reply-To: <871rr4op14.fsf@iki.fi> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::732 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122380 Archived-At: On 2/8/20 2:30 PM, Teemu Likonen wrote: > Douglas Lewan [2020-02-08T14:17:54-05] wrote: > >> I'm writing some code that includes the regular expression \\([^/]+/\\), >> (looking for a path on GNU/Linux) which doesn't match what I expect it >> should. > Maybe your backslash escaping is wrong. In regular expressions the > grouping is made with \( \) but within Lisp strings backslash has a > special meaning too and those must be escaped "\\( \\)". Damn! I was passing the double slash to a command I use to help me debug regular expressions. Hand it the right string and it matches just as expected. (Too much kill-and-yank.) Maybe now I can track down the real bug. Thanks for helping me change my perspective. >> Is there something I'm missing? > I think we need more information about your code and input data. -- ,Doug d.lewan2000@gmail.com (908) 720 7908 Isn't there a difference between "acquittal" and "exoneration"?