FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » body mangling - regex
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
body mangling - regex [message #27478] Fri, 09 September 2005 12:14 Go to next message
davidgordon is currently offline  davidgordon   United Kingdom
Messages: 25
Registered: May 2005
Karma: 0
Junior Member
I want to remove a multi line mailing list footer from emails imported to FUDForum using maillist.php

I'm a little hard of thinking when it comes to regex. Would someone save me from having to do the advanced course and show me how to remove something like

--------------------------
Mailing List
Line about posting
Another line about archive
--------------------------

for example?

I have tried entering the footer in the body mangling section of the Mailing List Manager but am only able to enter the first line. This gets removed as expected! But how can I remove the whole multi line footer?

Thanks you

Re: body mangling - regex [message #27486 is a reply to message #27478] Fri, 09 September 2005 14:00 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Well you can remove everything from the start of the footer till the end. So if the footer starts with something like:

-------------------

your regex can be

-------------------.*$
and set "s" flag


FUDforum Core Developer
Re: body mangling - regex [message #27506 is a reply to message #27478] Fri, 09 September 2005 15:28 Go to previous messageGo to next message
davidgordon is currently offline  davidgordon   United Kingdom
Messages: 25
Registered: May 2005
Karma: 0
Junior Member
Thanks. When I copy my original footer (and add the required regex) I can only paste the first line into the body mangling fields of Mailing List Manager. Is there a limit to the size? Or is there a problem because I am trying to enter a multi line footer?

I'm running FUDForum 2.7.2RC1

Thank you.
Re: body mangling - regex [message #27507 is a reply to message #27506] Fri, 09 September 2005 15:36 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
If you enter a multi-line footer you need format it so that it is on one line.

FUDforum Core Developer
Re: body mangling - regex [message #27508 is a reply to message #27486] Fri, 09 September 2005 16:13 Go to previous messageGo to next message
davidgordon is currently offline  davidgordon   United Kingdom
Messages: 25
Registered: May 2005
Karma: 0
Junior Member
Ilia wrote on Fri, 09 September 2005 10:00


your regex can be

-------------------.*$
and set "s" flag


I'm sorry but I find this quite difficult!

I tried the above suggestion but the result is "No Message Body" - all my message is stripped out.

Should there not be a "^" characture to show the start of the string I wish to remove? Does having a hyphen ("-") act as a regex command and need escaped? I'm not sure what the "s" flag does.

I'm sure this is very easy really...

Thank you again.
Re: body mangling - regex [message #27511 is a reply to message #27508] Fri, 09 September 2005 20:21 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Take a look @ pcre regex examples on php.net this is the engine powering FUDforum's message mangling mechanism.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Sort of pinned threads
Next Topic: Variable
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 20:44:47 GMT 2024

Total time taken to generate the page: 0.02463 seconds