It seems that it's / within the '-quoted string that= causes the problem:

print \${QE//'0=3D\${\${(M)\${0::=3D\${(%):-= %x}}:#\/*}:-\$PWD\/\$0}'/=C2=B0match=C2=B0}

outputs =C2= =B0match=C2=B0, while:

print \${QE//'0=3D\${\${(M)\${0::=3D\${(%):-%x}}:#= /*}:-\$PWD/\$0}'/=C2=B0match=C2=B0}

doesn't. Isn't it a bug of = ignoring '-quoting of /?

On Wed, 25 Jan 2023 at 12:59, Sebastian Gniazdowski <sgniazdowski@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">
Ok, I'll take a closer look, however I'm now struggling with simil= ar problem:

QE=3D'0=3D\${\${(M)\${0::= =3D\${(%):-%x}}:#/*}:-\$PWD/\$0}'
print \${QE//'0=3D= \${\${(M)\${0::=3D\${(%):-%x}}:#/*}:-\$PWD/\$0}'/=C2=B0match=C2=B0}
=

the strings in QE and in =E2=80=A6//'=E2= =80=A6'/=E2=80=A6 are identical. Why no match? A simpler example works = as expected:

QE=3Dqeqe

<= /div>
Output:

=C2=B0match=C2=B0=

On Wed, 25 Jan 2023 at 12:36, Roman Perepelitsa <roman.perepelitsa@gmail= .com> wrote:
On Wed, Jan 25, 2023 at 12:05 PM Sebastian Gniazdowski
<sgniazdowsk= i@gmail.com> wrote:
>
> Hi,
> I'm storing a pattern in a var:
>
> E=3D"0=3D'\\${\\${\\(M\\)\\${0::=3D\\${\\(%\\):-%x}}:\\#/\\*}:-\\$= PWD/\\$0}'"
>
> to then match it against:
>
> Q=3D'0=3D\${\${(M)\${0::=3D\${(%):-%x}}:#/*}:-\$PWD/\$0}'
>
> with // substitution:
>
> printf %s\\n \$E \$Q \${Q//\$~E/q}
>
> The result is no match. However, if I instead quote the string with \:=
>
> E=3D'0=3D\${\${\(M\)\${0::=3D\${\(%\):-%x}}:\#/*}:-\$PWD/\$0}'

You can print them to see the difference:

=C2=A0 =C2=A0 % E=3D"0=3D'\\${\\${\\(M\\)\\${0::=3D\\${\\(%\\):-%x}}:\= \#/\\*}:-\\$PWD/\\$0}'"
=C2=A0 =C2=A0 % print -r -- \$E
=C2=A0 =C2=A0 0=3D'\${\${\(M\)\${0::=3D\${\(%\):-%x}}:\#/\*}:-\$PWD/\$0}'=

=C2=A0 =C2=A0 % E=3D'0=3D\${\${\(M\)\${0::=3D\${\(%\):-%x}}:\#/*}:-\$PWD/\$0}= '
=C2=A0 =C2=A0 % print -r -- \$E
=C2=A0 =C2=A0 0=3D\${\${\(M\)\${0::=3D\${\(%\):-%x}}:\#/*}:-\$PWD/\$0}

As you can see, the first `E` has three extra characters: two quotes
and a backslash.

Roman.

--
Best regards,
Sebastian Gniazdowski

--
Best regards,
Se= bastian Gniazdowski

--000000000000ca9a0705f3165ae5--