The KB recommends using this technique to create a data input mask for formatting telephone numbers.

URL:

Creating a data input mask for formatting telephone numbers | FileMaker

Wouldn't this work as well?

A Calculated Value: L_Insurance Phone Number

Let(

Digits = Filter(L_Insurance Phone Number; "0123456789");

Case (

GetAsNumber ( L_Insurance Phone Number ) < 10000 ;

Right(Digits; 4) ;

GetAsNumber ( L_Insurance Phone Number ) < 10000000 ;

Middle(Digits; 1; 3) &

"-" & Right(Digits; 4) ;

GetAsNumber ( L_Insurance Phone Number ) < 10000000000 ;

"(" & Left(Digits; 3) & ") " & Middle(Digits; 4; 3) &

"-" & Right(Digits; 4) ;

GetAsNumber ( L_Insurance Phone Number ) < 100000000000 ;

"+" & Left(Digits; 1) & " (" & Middle(Digits; 2; 3) & ") " &

Middle(Digits; 5; 3) & "-" & Right(Digits; 4) ;

"Invalid"

)

)

More or less, but using Let() consequently, this can be written much cleaner:

Let ( [

d = Filter ( L_Insurance Phone Number ; "0123456789" ) ;

l = Length ( d ) ;

right4 = Right ( d ; 4 ) ;

left3 = Left ( d ; 3 )

] ;

Case (

l = 4 ;

right4 ;

l = 7 ;

left3 & "-" & right4 ;

l = 10 ;

"(" & left3 & ") " & Middle ( d ; 4 ; 3 ) & "-" & right4;

l = 11 ;

"+" & Left ( d ; 1 ) & " (" & Middle ( d ; 2 ; 3 ) & ") " & Middle ( d ; 5 ; 3 ) & "-" & right4 ;

"Invalid"

)

)

And as Bruce said: Why not try it yourself, and ask if/when you run into trouble?