I don't claim to be a regular expression expert (just a long time list lurker), but I recently had the same need for a trim command and came up with this function: function trimWS pText -- Remove all leading and trailing whitespace characters. -- I.E., space, tab, carriage return, line feed, form feed. return replaceText(pText,"(^\s+)|(\s+$)",empty) end trimWS Gary