Hello,
I am not sure why this is not working. Is it a bug?
In utop:
#require "str";;
Str.(full_split (regexp "[\\]\\[]") "[toto]titi[tata]");;
- : Str.split_result list = [Str.Text "[toto]titi[tata]"]
Str.(full_split (regexp "[\\[\\]]") "[toto]titi[tata]");;
- : Str.split_result list = [Str.Text "[toto]titi[tata]"]
On the contrary, this one does what I expect:
Str.(full_split (regexp "[}{]") "{toto}titi{tata}");;
- : Str.split_result list = [Str.Delim "{"; Str.Text "toto"; Str.Delim "}"; Str.Text "titi"; Str.Delim "{"; Str.Text "tata"; Str.Delim "}"]
So, I start to suspect that there is incorrect handling by Str of ‘[’ and ‘]’ in character sets.
Regards,
F.