From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Abdulrahman Semrie Newsgroups: gmane.lisp.guile.bugs Subject: bug#36251: Regex library doesn't recognize ']' in a character class Date: Sun, 16 Jun 2019 20:16:29 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="5d06796d_2ae8944a_198" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="18701"; mail-complaints-to="usenet@blaine.gmane.org" To: 36251@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Jun 16 20:47:35 2019 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hcaBi-0004kS-If for guile-bugs@m.gmane.org; Sun, 16 Jun 2019 20:47:34 +0200 Original-Received: from localhost ([::1]:42102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcaBh-0007pp-J9 for guile-bugs@m.gmane.org; Sun, 16 Jun 2019 14:47:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59224) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcaBZ-0007Wv-Mg for bug-guile@gnu.org; Sun, 16 Jun 2019 14:47:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcZwg-00022I-KI for bug-guile@gnu.org; Sun, 16 Jun 2019 14:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56105) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hcZwg-00021x-4v for bug-guile@gnu.org; Sun, 16 Jun 2019 14:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hcZwg-00077w-0U for bug-guile@gnu.org; Sun, 16 Jun 2019 14:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Abdulrahman Semrie Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 16 Jun 2019 18:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36251 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.156070990027360 (code B ref -1); Sun, 16 Jun 2019 18:32:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Jun 2019 18:31:40 +0000 Original-Received: from localhost ([127.0.0.1]:41416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hcZwJ-00077D-KK for submit@debbugs.gnu.org; Sun, 16 Jun 2019 14:31:40 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:40883) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hcYll-00055I-KW for submit@debbugs.gnu.org; Sun, 16 Jun 2019 13:16:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43623) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcYlk-0003Yr-Gr for bug-guile@gnu.org; Sun, 16 Jun 2019 13:16:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcYlj-0004ol-Dp for bug-guile@gnu.org; Sun, 16 Jun 2019 13:16:40 -0400 Original-Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:34750) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hcYlj-0004oC-3n for bug-guile@gnu.org; Sun, 16 Jun 2019 13:16:39 -0400 Original-Received: by mail-wr1-x429.google.com with SMTP id k11so7418046wrl.1 for ; Sun, 16 Jun 2019 10:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:subject:mime-version; bh=VDj2LKdtTd0lluO5q65ex7uCXppJLYUc/ZweOK4yXJU=; b=kN7Q+7rjSKj3fvWiP9dwbbhgH7QEgb84ulsccIqbf4UvDDvAdM8LhGsYBLZgLcEvFw d20LVOEvCCgIjA2WKbA43jfkLpQ3QtK+EN9DiH6EGxHUAH712b8AsD85J+cHxUkjfyMu QNv8G05lK2//US/Ej8D6A8GwLEBuG2lHSpV+bN1aWyAX+69GAd1dR0JCAiBdY5oIvgG8 tPn1NcVidbf1ylIkN3Eqho9ICbr0LQnsMRrz+tsawKT20qbuzepKiQ5Wn1KGkidklqpL G3PCDDlPiXn/p8qMrwPpo7BL+ZqVLd0haebQxIEJZZI3j1IZ047rohipRiwDjtS0PReQ p/LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:message-id:subject:mime-version; bh=VDj2LKdtTd0lluO5q65ex7uCXppJLYUc/ZweOK4yXJU=; b=mrMg8EtsnnLkymE1wrkVLPg0zKwJt9Rz/4e8PU+O74bfpZg2sdE9GQ2L+aftVNGSJN jna7+xlcUii7lDLbNIuTGvNx5G9rF/OAPRPdAWE5w+RX2B+ooPpqhE5RdwziwnwV0k4p A0SlZvxR16EJXTGbZxrU3iCV9a8c4D92llLoMwBJ8sMbCdSP3RSbFAM7M8LTPQQnsQaj 0Ch7PsI3sSYnW+/IB2bVGS6nOOiLTVea7JcO2PwRquSlYnkgyItU5j6gh1MAQY0nWDGI RtmeHJt8sAPKHvX3pMujURcZFMVkLL4/SB83aFoC9tUauQ1CWaidj+zHQT6hWX+lihsb UKhQ== X-Gm-Message-State: APjAAAVYVj0eyC/WkNYkEwSeHoWerbXDSq8HhkzX40bulrUE+Ngqj2KY F1ZWXczrkMBHza/6S5y98Y86G3wkFhkTig== X-Google-Smtp-Source: APXvYqwnc0umvCmvjRbPkqkFD4c5Yufr86DEggdHuYeCEPzWUrk1+bV4v7vQFuV0+/d2Uv9CmoFjcA== X-Received: by 2002:adf:eb4e:: with SMTP id u14mr25990710wrn.168.1560705397231; Sun, 16 Jun 2019 10:16:37 -0700 (PDT) Original-Received: from [192.168.1.2] ([196.188.48.118]) by smtp.gmail.com with ESMTPSA id a2sm11329444wmj.9.2019.06.16.10.16.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Jun 2019 10:16:36 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Sun, 16 Jun 2019 14:31:39 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9346 Archived-At: --5d06796d_2ae8944a_198 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I am using the pattern =5B=5C=5C=5B=5C=5C=5Da-zA-Z=5D+ to match a string = with left or right bracket in it. However, the string-match function does= n=E2=80=99t match the =E2=80=98=5D=E2=80=99 character. To demonstrate wit= h an example, try the following funciton: (string-match =22=5B=5C=5C=5B=5C=5C=5Da-zA-Z=5D+=22 =22Text=5Bab=5D=E2=80= =9D) The result for the above function should have been a match structure with= Text=5Bab=5D matched. However, the string-match returns =23f which is in= correct. To test if the pattern I am using was right, I tried on regex101= .com and it works. Here (https://regex101.com/r/VAl6aI/1) is the link tha= t demonstrates that it works. Hence, the above leads me to believe there is a bug in the regex library = that mishandles =5D character in character-classes =E2=80=94 Regards, Abdulrahman Semrie --5d06796d_2ae8944a_198 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline

<= div>
I am using the pattern =5B=5C=5C=5B=5C=5C=5Da-zA-Z=5D= + to match a string with left or right bracket in it. However, the= string-match function doesn=E2=80=99t match the =E2=80= =98=5D=E2=80=99 character. To demonstrate with an example, try the= following funciton:

(string-match =22=5B=5C=5C=5B=5C=5C=5D= a-zA-Z=5D+=22 =22Text=5Bab=5D=E2=80=9D)

The result for the = above function should have been a match structure with Text=5Bab=5D= matched. However, the string-match returns = =23f which is incorrect. To test if the pat= tern I am using was right, I tried on regex101.com and i= t works. Here is the = link that demonstrates that it works.

Hence, the above leads me t= o believe there is a bug in the regex library that mishandle= s =5D character in character-classes


=E2=80= =94

Regards,

Abdulrahman Semrie

--5d06796d_2ae8944a_198--