regEx to remove spaces ?

John Craig jc at spl21.net
Fri May 19 06:44:02 EDT 2006


Apologies - sent the wrong snippet earlier. The correct version (very

similar) is;

Here's a small snippet that will replace spaces within quotes using 
regex's.  Just put your data into tString and the new data is put into 
tResult.

put tString into tResult
repeat while matchText(tString, "([" & quote & "][^" & quote & "]+[" & quote & "])", tMatch)
 put replaceText(tMatch, " ", "") into tReplacement
 put replaceText(tResult, tMatch, tReplacement) into tResult
 put replaceText(tString, tMatch, "") into tString
end repeat


Hope this is of use, JB.

JC









More information about the use-livecode mailing list