Warning to user for including cursing words in private message Drupal 7.
Drupal 6 had a way to configure a rule to check for disallowed words inside the body or subject line of a private message.

I am trying to adapt that rule to Drupal 7. 
The purpose of this check is to send a warning message to the sender (email or private message) if banned words are found in his message. This can be expanded to various actions, including a temporary ban then a permanent ban if the user persists.

Here is an export of the first rule (but I can't get it to work:)

{ "rules_warning_to_privatemsg_sender_about_curse_words_" : {
    "LABEL" : "Warning to privatemsg sender about curse words.",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "rules_i18n", "privatemsg_rules" ],
    "ON" : { "privatemsg_insert" : [] },
    "IF" : [
      { "text_matches" : {
          "text" : [ "privatemsg-message:body" ],
          "match" : "word1|word2|word3",
          "operation" : "regex"
        }
      }
    ],
    "DO" : [ { "drupal_message" : { "message" : "Bad word!", "type" : "warning" } } ]
  }
}    


Word1, word2, and word3 are the words to check for. They are separated by the "|" (pipe or vertical bar) character.

This format was agreeable with Drupal 6 but I am not sure if that still works with Drual 7. 

UPDATE: After studying the Regex website, I was able to get the rule to work changing the expression. See my answer below.
Finally found a format that works.

Contrary to what the Drupal documentation says, the format: 

word1|word2|word3


does not work.

The proper syntax is: 

^.*(word1|word2|word3).*$


i.e.: caret then dot then star then open parenthesis then the words to search separated with a vertical bar then closed parenthesis then dot then star then dollar sign.

Many words may be added between the parenthesis. No need to add the plurals as regex will match the singular inside the plural.

Reminder: Regex stands for REGular EXpression so this value must be selected at the bottom of the condition page.