I need to parse a imap response to get the base64 string of a file.
The string is something like that:
--------------A5B0A8B4F69F8BD959B758D0
Content-Type: application/pdf;
name="Myfile.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="Myfile.pdf"
JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlL1hPYmplY3QvQ29sb3JT
ZWI0ODRmNDE1ZDE0YmIyZmU2YjAzZDMzNjU+PGU5MDFiZTMzY2FlOTY4ZDM2
NmFmOGNhOTUxNTE0Nzk0Pl0vSW5mbyAyMyAwIFIvU2l6ZSAyND4+CnN0YXJ0
eHJlZgoyMzg2NgolJUVPRgo=
--------------A5B0A8B4F69F8BD959B758D0--
I need to get anything after filename="Myfile.pdf"
(possibly excluding space) and before new line after =
I am trying with this regexp without success:
(?<=filename="Myfile\.pdf")(.*)(?=\r\n)
Actually I am not sure if there are spaces or new lines chars in the base64 string, I do not think.