Overview
| Artifact ID: | fb9c71b0b950185850d3c844e13294c4bf0c166c45ccdfd9df6d89d6f42f4f03 |
|---|---|
| Ticket: | 3556218fffffffffffffffffffffffffffffffff
string match & glob: close-bracket in character set |
| User & Date: | serhiy.storchaka on 2026-10-19 17:43:27 |
Changes
- 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"