- # All of the unprotected brackets are escaped, which means that we must
- # escape all the commas.
- print 'ok' if wc2re_unix('{a{b\\,c\\}d\\,e}') eq '\\{a\\{b\\,c\\}d\\,e\\}';
+ # The first comma is replaced, and the remaining brackets and comma are
+ # escaped.
+ print 'ok' if wc2re_unix('{a\\{b,c}d,e}') eq '(?:a\\{b|c)d\\,e\\}';
+
+ # All the brackets and commas are escaped.
+ print 'ok' if wc2re_unix('{a{b,c\\}d,e}') eq '\\{a\\{b\\,c\\}d\\,e\\}';