bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#36251: Regex library doesn't recognize ']' in a character class


From: Abdulrahman Semrie
Subject: bug#36251: Regex library doesn't recognize ']' in a character class
Date: Sun, 16 Jun 2019 20:16:29 +0300


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 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]