regEx to remove spaces ?

Sivakatirswami katir at hindu.org
Fri May 19 04:48:15 EDT 2006


On May 16, 2006, at 11:45 PM, jbv wrote:

> Hi list,
>
> Is it possible to use regEx to remove spaces before and
> after quotes, and, if yes, how ?
>
> Example :
>     my " beautiful " laundrette
> becomes
>     my "beautiful" laundrette

I'm curious what mandates regEx?

if the means is not an issue in reaching the goal ,  doesn't  
"replace" work for you?

This is obvious, but for the record:

function wipeQuotedSpaces tText
	put (quote & " ") into tOpenSpace
	put ( " " & quote) into tCloseSpace
	replace tOpenSpace with quote in tText
	replace tCloseSpace with quote in tText
	return tText
end wipeQuotedSpaces

>
> Thanks,
> JB




More information about the use-livecode mailing list