RegEx Replace Text -- strip leading and trailing spaces

Trevor DeVore lists at mangomultimedia.com
Wed Apr 13 12:09:00 EDT 2005


On Apr 13, 2005, at 3:14 AM, Matt Denton wrote:

> G'day all
>
> Regular Expression syntax in ReplaceText is driving me a bit loopy 
> right now, I was hoping someone out there could work out what I'm 
> doing wrong...
>
> I want a single RegEx expression using ReplaceText to strip out 
> leading and tailing spaces, leaving any spaces in the middle 
> untouched.

Matt,

I use this regex to strip whitespace:

get replaceText(pString, "^[ \t\r\n]+|[ \t\r\n]+$", "")


-- 
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com



More information about the use-livecode mailing list