There is a regex that should automatically remove all greetings from the top of posts. It does its job very well:
^ # begins at start of body
\s* # possible spaces
(
hii?(?![a-z])| # any of these greeting words
hello|
h(e|a)y(?![a-z])|
dear|
greetings|
hai|
guys|
howdy|
h(i|e)ya|
hola
)
.*? # followed by anything, up to...
(
[.,;!-]+ # one or more bits of punctuation
\s* # possible spaces
|
(\r?\n)+ # one or more newlines
)
I propose we add one for "thanks" and related endings. Here is my draft:
\s*
(
(and\s*)?(\+\s*)?(with\s*)?
(so\s*)?(many\s*)?(mu?ch\s*)?
(lots\s*(of\s*)?)?
((tha?nk)|(thx)|(thnx)|regard)s?\s*
(you\s*)?
(in adva?nced?\s*)?
((a\s*)?lots?\s*)?
(((very\s*)|(so\s*))?mu?ch\s*)?
((and\s*)?(\+\s)?regards?\s*)?
[\.\!]*\s*
([\:\;]\s*[\-\~\=]*\s*[\)\]\}\>D3]+)* #smilies :) :D ;-3 etc.
[\.\!]*\s*
)
$
I am sure there could be many improvements, but it's a start. And it will save many an editor's time.
And because I couldn't resist the irony:
Thanks!
MyString = thanks
code:thanks
)d?
inadva?nce?d
. That drives me nuts. However, I predict this could have a high rate of failure or false positives, perhaps too much to be worth it.