First of all, thank you for reading my question. There is a mechanism I read where the pyrrole reacts with its C2 but I can't draw the arrows so I don't know if I am correct to think that :
the ester: is a deactivating group because it has a Mesomeric electron-withdrawing effect (M-) so it deactivates the C4 the methoxy: is an activating group because of its electron-donating effect (M+) so it activates the C4
--> and M+>M- so it will react on C4
But the pyrrole likes to react on its C2 but it is deactivated by the ester (because in para)
Please explain me how does it work I am very lost...