first letter in a word to uppercase using RegEx

Is there a way to use regualr expression to convert the first letter in every word to uppercase, the rest lower case
ex: THIS IS A TEST
to
This Is A Test

s/^[A-Z ]+/\U\1/g

although this code will not work in xojo as far i know,

why not just use

s=s.titlecase

that seems much better

thank you