On 12/09/15 06:29, Sebastian Nielsen wrote: > So the rule is as follows: > /[ \t\r\f]*-----(BEGIN|END)([^-]*)-----[ \t\r\f]*/ REPLACE -----$1$2----- > > The problem with this, is that this removed the whole body of the mail > except for the -----BEGIN PGP MESSAGE----- line. > > What are im doing wrong? I have tried with different flags like /s or > /si and such, but still it removes the whole body. > I want it to scan line for line and process it.
This is just a wild guess on my part, but could that possibly be matching: > -----BEGIN BLAH----- ^^^^^^^^^^^^^^^ > yadda yadda yadda ^^^^^^^^^^^^^^^^^ > -----END BLAH----- ^^^^^^^^^^^^^ and giving you: $1="BEGIN", $2=" BLAH-----\r\nyadda yadda yadda\r\n-----END BLAH"? What happens if you try /[ \t\r\f]*-----(BEGIN|END)([A-Z ]*)-----[ \t\r\f]*/ REPLACE -----$1$2----- instead? -- Stuart Longland (aka Redhatter, VK4MSL) I haven't lost my mind... ...it's backed up on a tape somewhere.