WorkField:=fieldname;
TrimChars:=" abcdefghijklmnopqrstuvwxyz `~!@#$%^&*()-_+={}][:\"\',./?><";
tempNum:=@Implode(@Trim(@Explode(@LowerCase(WorkField);TrimChars) );"");
REM "tempNum now has just the numbers which can be";
REM "formatted the way you would like.";
REM "The following works for US format phone nos";
REM "It merely takes the first 10 digits and ";
REM "constructs the phone number in the format";
REM "xxx.xxx.xxxx";
REM "It ignores any characters more than 10 and";
REM "does not do anything if less than 10";
@If(
@Length(tempNum)>=10;
@Left(tempNum;3)+"."+ @Right(@Left(tempNum;6);3)+"."+ @Right(@Left(tempNum;10);4);
tempNum
)