Code:
/^\s+|\s+$/g
This works great thanks !!!!

Can someonbe explain these parts though - I knowwhat the replace bit does, but can't find any of hese in my books, what do each parts of this statement mean please ?