Artifacts Associated With Ticket 3556218fffffffffffffffffffffffffffffffff
Ticket change [14fdddf2a3] (rid 124489) by avl42 on 2012-08-11 00:22:57:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
As of now, it is not possible to include a close-bracket character in a bracketed set of allowed characters. [scan]'s format uses bracketed sets of allowed characters, too, and it *does* allow a close-bracket as first char. Having looked into the implementation of tcl's string-globbing, it seems that *before* entering that loop over the bracketed characters, an initial check for ']' in the pattern and in the string to be matched would be a really simple fix. Doing it that way, would even still allow a dash to be included verbatim, as well, by placing it right after the close-bracket.
- foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "avl42"
- subsystem initialized to: "18. Commands M-Z"
- title initialized to:
string match & glob: close-bracket in character set
- type initialized to: "Bug"
Ticket change [0fe61ee5c8] (rid 94873) by dkf on 2012-08-13 06:19:51:
- foundin changed to: "obsolete: 8.5.12"
- icomment:
See also Bug 219233, for related issues.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
Ticket change [fb9c71b0b9] (rid 259305) by serhiy.storchaka on 2026-10-19 17:43:27:
- foundin changed to: "8.6.18, 9.0.5, 9.1.0"
- icomment:
Still present in 8.6, 9.0 and 9.1: there is no way to include a closing bracket in a set. Backslash is not special inside a set, and <tt><nowiki>{[]a]}</nowiki></tt> never matches anything. The only workaround was a range ending in the closing bracket, which always includes other characters: the narrowest one, <tt><nowiki>{[\-]]}</nowiki></tt>, also matches a backslash. And such ranges are what [219233ffff] removes. Proposed fix for 9.1 in branch [/timeline?r=glob-bracket-posix|glob-bracket-posix], together with [219233ffff]: a closing bracket right after the opening one is a member of the set, as in POSIX and Python's fnmatch, so <tt><nowiki>{[]a]}</nowiki></tt> matches "]" or "a". Such patterns never matched before, so nothing that works changes. string.n now describes both rules. Test string-11.58. - login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"