You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function mc_search__glob_translate_to_regex() in lib/search/glob.c is horribly broken, and mishandles a number of trivial patterns such as: - an inverted character class: "[^abc]" or "[!abc]" - a freestanding comma: "abc,def" - a literal brace: "{" or "}" - an incorrectly formed brace expansion: "{abc}" - a sequence expression: "{5..10}" or "{a..f}"
Also, a nested brace expansion: "a{b,c{d,e}}f" will produce capturing parentheses for every pair of braces, instead of only the outermost pair.
All this because current code is far too simple-minded to correctly convert Bash patterns into PCRE regexes, and needs a complete rewrite.
Important
This issue was migrated from Trac:
wjaguar(@wjaguar)Function mc_search__glob_translate_to_regex() in lib/search/glob.c is horribly broken, and mishandles a number of trivial patterns such as:
- an inverted character class: "[^abc]" or "[!abc]"
- a freestanding comma: "abc,def"
- a literal brace: "{" or "}"
- an incorrectly formed brace expansion: "{abc}"
- a sequence expression: "{5..10}" or "{a..f}"
Also, a nested brace expansion: "a{b,c{d,e}}f" will produce capturing parentheses for every pair of braces, instead of only the outermost pair.
All this because current code is far too simple-minded to correctly convert Bash patterns into PCRE regexes, and needs a complete rewrite.
Note
Original attachments:
borisonDec 20, 2014 at 22:41 UTCwjaguar(@wjaguar) onFeb 26, 2025 at 22:39 UTCwjaguar(@wjaguar) onFeb 26, 2025 at 22:40 UTCwjaguar(@wjaguar) onFeb 26, 2025 at 22:41 UTC