9 Replies Latest reply on Mar 30, 2007 6:43 PM by 807606

    regular expressions for replacing text with sms language text

      Hi, I'm trying to write a function which converts normal, correctly spelled text into the shorter sms language format but struggling to come up with the regular expressions i need to do so, can anyone help?
      1: remove surplus white space at the beginning of a sentence and at the end of a sentence.
      e.g. " hello." --> "hello." OR "hello ." --> "hello."

      2: remove preceeding and/or proceeding space if there's a word then a number possibly followed by another word
      e.g. "come 2 me" --> "come2me" OR "dnt 4get" --> "dnt4get"

      3: remove "aeiou" if word starts and ends with "!aeiou"
      e.g. "text" --> "txt"