Ok, I'll take a closer look, however I'm now struggl= ing with similar 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 Q= E and in =E2=80=A6//'=E2=80=A6'/=E2=80=A6 are identical. Why no mat= ch? A simpler example works as expected:

QE=3Dqeqe
print = \${(S)QE//'qeqe'/=C2=B0match=C2=B0}

Output:

On Wed, 25 Jan 2023 at 12:36, Roman Perepelit= sa <rom= an.perepelitsa@gmail.com> wrote:
On Wed, Jan 25, 2023 at 12:05 PM Sebastian Gniazdow= ski
<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
--00000000000096015b05f3163616--