Why can't I get the output of grep?

when I was in regular grep, I couldn"t get its output. How to solve this situation:

echo "AAA<%=CCC=%>BBB" | grep -Po "<%=(.+?)=%>"
var=$(echo "AAA<%=CCC=%>BBB" | grep -Po "<%=(.+?)=%>")
echo $var
Mar.29,2021

this problem does not exist, but is caused by the use of mingw64, in the test environment. Thank you @ Feng_Yu for your kind reply.

Menu