2022年11月18日(金) 2:11 Chet Ramey <chet.ra...@case.edu>:
> "If a pattern ends with an unescaped <backslash>, it is unspecified whether
> the pattern does not match anything or the pattern is treated as invalid."
>
> Bash uses the former interpretation. If "the pattern is treated as invalid"
> means trying to literally match the open bracket and going on from there,
> your interpretation is valid as well. The standard doesn't use that
> language in other places it specifies to treat the bracket as an ordinary
> character to be matched literally, however.

Thank you for the explanation. I haven't been considering the
consistency with the treatment of the slashes outside the bracket
expression. I think I need to adjust the treatment of the slash in my
new engine by introducing e.g. a special flag for <not matching
anything>. Thank you.

--
Koichi

Reply via email to