Currently custom field regex can only validate the text entered in the field.
Allowing .gsub method(Ruby) will allow auto formatting also.
ex) social security number (000-00-0000)
1112 => 111-2
11122 => 111-22
1112233 => 111-22-33
111223333 => 111-22-3333