From unknown Sat Aug 09 04:57:07 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#12665 <12665@debbugs.gnu.org> To: bug#12665 <12665@debbugs.gnu.org> Subject: Status: regexp fault for closing square bracket within character class Reply-To: bug#12665 <12665@debbugs.gnu.org> Date: Sat, 09 Aug 2025 11:57:07 +0000 retitle 12665 regexp fault for closing square bracket within character class reassign 12665 guile submitter 12665 Panicz Maciej Godek severity 12665 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 17 15:58:53 2012 Received: (at submit) by debbugs.gnu.org; 17 Oct 2012 19:58:53 +0000 Received: from localhost ([127.0.0.1]:48863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TOZlV-00055H-5U for submit@debbugs.gnu.org; Wed, 17 Oct 2012 15:58:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35937) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TOZOt-0004Xq-GH for submit@debbugs.gnu.org; Wed, 17 Oct 2012 15:35:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOZNS-00019h-WA for submit@debbugs.gnu.org; Wed, 17 Oct 2012 15:34:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:49115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOZNS-00019d-Sk for submit@debbugs.gnu.org; Wed, 17 Oct 2012 15:34:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOZNR-0001Au-Q6 for bug-guile@gnu.org; Wed, 17 Oct 2012 15:34:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOZNQ-00019N-Ra for bug-guile@gnu.org; Wed, 17 Oct 2012 15:34:01 -0400 Received: from mail-ee0-f41.google.com ([74.125.83.41]:52429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOZNQ-00019I-KM for bug-guile@gnu.org; Wed, 17 Oct 2012 15:34:00 -0400 Received: by mail-ee0-f41.google.com with SMTP id c4so5194955eek.0 for ; Wed, 17 Oct 2012 12:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=3K9YYmIh7Brf2uXt3cULFVSC1uAG+51uRcIG1gwPy2g=; b=I5eVQn6J9GxycfJgfqjxDyDBA1AYFVFXjcOpkQ+kMP8FHe83ozwrsL07dyFAIvzeGa QwgL2QdTIA5QE23jeXOX8bevMkveyYcoz2/umP6jHanHlsTKjh6bisxHCe0aP3MTWYqV lyttf65qXlYVx/cImsNA/BQgbE27kzZNW4OdJq8MZ3X/0jU+aJxSVPGe/ETVGXm4iYAV F8F2FUedcbUOg6VncQuCXYLDbx6RHzYMc4+VAY02s19PgerZGh1KcDvH3gOWdYyVdzqV HGeWLML+LeEeLL33i1yfT6rU8NYK8dovt2QlmGI62ZLIHa4DX/gu9KFmBKopCBJw/Vws tD4g== MIME-Version: 1.0 Received: by 10.14.194.72 with SMTP id l48mr28777144een.9.1350502439021; Wed, 17 Oct 2012 12:33:59 -0700 (PDT) Received: by 10.14.212.6 with HTTP; Wed, 17 Oct 2012 12:33:58 -0700 (PDT) Date: Wed, 17 Oct 2012 21:33:58 +0200 Message-ID: Subject: regexp fault for closing square bracket within character class From: Panicz Maciej Godek To: bug-guile@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 17 Oct 2012 15:58:52 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) guile 2.0.5-deb+1-1 (string-match "[\\[]" "[") ===> #("[" (0 . 1)) (string-match "[\\]]" "]") ===> #f From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 18 00:55:42 2012 Received: (at 12665-done) by debbugs.gnu.org; 18 Oct 2012 04:55:42 +0000 Received: from localhost ([127.0.0.1]:49137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TOi8z-0001tq-Ku for submit@debbugs.gnu.org; Thu, 18 Oct 2012 00:55:42 -0400 Received: from world.peace.net ([96.39.62.75]:58009 ident=hope4) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TOi8v-0001tf-NA for 12665-done@debbugs.gnu.org; Thu, 18 Oct 2012 00:55:38 -0400 Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TOi7V-000113-As; Thu, 18 Oct 2012 00:54:09 -0400 From: Mark H Weaver To: Panicz Maciej Godek Subject: Re: bug#12665: regexp fault for closing square bracket within character class References: Date: Thu, 18 Oct 2012 00:54:01 -0400 In-Reply-To: (Panicz Maciej Godek's message of "Wed, 17 Oct 2012 21:33:58 +0200") Message-ID: <87txtsqt1y.fsf@tines.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 12665-done Cc: 12665-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) Panicz Maciej Godek writes: > guile 2.0.5-deb+1-1 > (string-match "[\\[]" "[") > ===> #("[" (0 . 1)) > (string-match "[\\]]" "]") > ===> #f As documented in "Syntax of Regular Expressions" of the Emacs manual (to which section 6.15 of the Guile manual refers): To include a `]' in a character set, you must make it the first character. For example, `[]a]' matches `]' or `a'. To include a `-', write `-' as the first or last character of the set, or put it after a range. Thus, `[]-]' matches both `]' and `-'. For example: (string-match "[]\\]" "]") ==> #("]" (0 . 1)) Note that backslash is also a member of this character class, and of the character class in your first example: (string-match "[]\\]" "\\") ==> #("\\" (0 . 1)) (string-match "[\\[]" "\\") ==> #("\\" (0 . 1)) You might have been thinking that the backslash would escape the square brackets in your class, but that's not how it works within character classes. '[' can be included anywhere in a character class without being escaped, and ']' and '-' are handled as described above. Regards, Mark From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 18 05:46:02 2012 Received: (at 12665-done) by debbugs.gnu.org; 18 Oct 2012 09:46:02 +0000 Received: from localhost ([127.0.0.1]:49398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TOmfx-0000XC-Si for submit@debbugs.gnu.org; Thu, 18 Oct 2012 05:46:02 -0400 Received: from mail-ie0-f172.google.com ([209.85.223.172]:53335) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TOmfv-0000Wi-JW for 12665-done@debbugs.gnu.org; Thu, 18 Oct 2012 05:46:00 -0400 Received: by mail-ie0-f172.google.com with SMTP id 9so13700304iec.3 for <12665-done@debbugs.gnu.org>; Thu, 18 Oct 2012 02:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=SJkxaqiUiMJivD5r53S5rp2DK2t04paONyhLoEbnN4g=; b=Y5L2DZts+9w+y3XzAIPw5wMp8ylNhjl2ANyEKjbqfXKfqPHpNc9iB3SzI9EoTG6ALH Tq3X1RYJl7IV9/R/USs7athDXMZL2l4FZaB8BIqeRv+ZUjlR+Dn69pK08gbuDrAu6ExW gUZ/w4YXMWEHJv9MOryzbBNpB+L0xbhV0BDoMEqbgFqJ3pmON2BlvDX/yep7Y/cpbMmz /LAXkStTbRmAwncu+NH9/EGMNoNq+GqyAxeaElLCwAfcck7Yo2BEUlXPYGx/TLc42UMV +3YbcpcjtqvqO/LnSKvA4BoggaZBSJD/FlFvrJPkjhz1z0byn7ANpQJ8CwsIYg7arUVz nBNg== MIME-Version: 1.0 Received: by 10.50.151.172 with SMTP id ur12mr4155610igb.44.1350553470824; Thu, 18 Oct 2012 02:44:30 -0700 (PDT) Received: by 10.64.141.36 with HTTP; Thu, 18 Oct 2012 02:44:30 -0700 (PDT) In-Reply-To: <87txtsqt1y.fsf@tines.lan> References: <87txtsqt1y.fsf@tines.lan> Date: Thu, 18 Oct 2012 11:44:30 +0200 Message-ID: Subject: Re: bug#12665: regexp fault for closing square bracket within character class From: Panicz Maciej Godek To: Mark H Weaver Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 12665-done Cc: 12665-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) > As documented in "Syntax of Regular Expressions" of the Emacs manual > (to which section 6.15 of the Guile manual refers): > > To include a `]' in a character set, you must make it the first > character. For example, `[]a]' matches `]' or `a'. To include a > `-', write `-' as the first or last character of the set, or put > it after a range. Thus, `[]-]' matches both `]' and `-'. OK, I see. I guess I got used to PCRE for too long :) Sorry for my mistake. Regards From unknown Sat Aug 09 04:57:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 15 Nov 2012 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator