unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#36251: Regex library doesn't recognize ']' in a character class
@ 2019-06-16 17:16 Abdulrahman Semrie
  2019-06-16 19:40 ` tomas
  2019-06-18 11:08 ` Mark H Weaver
  0 siblings, 2 replies; 5+ messages in thread
From: Abdulrahman Semrie @ 2019-06-16 17:16 UTC (permalink / raw)
  To: 36251

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]


I am using the pattern [\\[\\]a-zA-Z]+ to match a string with left or right bracket in it. However, the string-match function doesn’t match the ‘]’ character. To demonstrate with an example, try the following funciton:

(string-match "[\\[\\]a-zA-Z]+" "Text[ab]”)

The result for the above function should have been a match structure with Text[ab] matched. However, the string-match returns #f which is incorrect. 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 that demonstrates that it works.

Hence, the above leads me to believe there is a bug in the regex library that mishandles ] character in character-classes

—

Regards,

Abdulrahman Semrie


[-- Attachment #2: Type: text/html, Size: 1546 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-06-28 11:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-16 17:16 bug#36251: Regex library doesn't recognize ']' in a character class Abdulrahman Semrie
2019-06-16 19:40 ` tomas
2019-06-18 11:08 ` Mark H Weaver
2019-06-18 11:20   ` tomas
2019-06-28 11:21   ` David Pirotte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).