Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: #% anchoring doesn't work with (S)



Could the bug be fixed? It already makes #% pretty much unusable for a backward compatible software, yet in say 4 years this would be changed, if the bug would be fixed today


On Mon, 30 Jan 2023 at 12:32, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
INPUT=ABC; INPUT=${(S)INPUT//#%((#b)(*))/°match°}; print $match
#no output

# Try to quote #
INPUT=ABC; INPUT=${(S)INPUT//\#\%((#b)(*))/°match°}; print $match
#no output

# Anchor with (#s)/(#e) instead:
INPUT=ABC; INPUT=${(S)INPUT//(#s)((#b)(*))(#e)/°match°}; print $match
#ouput correct:
ABC

# No S-flag
INPUT=ABC; INPUT=${INPUT//#%((#b)(*))/°match°}; print $match
#output correct
ABC

BTW, what were the rules of (#b) flag activity (or (#B))? It was something about "till the end of the parens".



--
Best regards,
Sebastian Gniazdowski



--
Best regards,
Sebastian Gniazdowski



Messages sorted by: Reverse Date, Date, Thread, Author