Function FrmRegex(str1, str2) As String
Dim regex As Object
Dim output
Set regex = CreateObject("VBScript.RegExp")
regex.Pattern = "(\d{6})(\d{2})(\d{3})"
output = regex.Replace(Format(str1, "00000000000"), "$1-$2.$3")
regex.Pattern = ".*(\d{7})$"
output = "AA : " + output + " BB : " + regex.Replace(str2, "$1")
FrmRegex = output
End Function
Sub TestFrmRegex()
Debug.Print FrmRegex("625017527", "1032946594-9356500")
End Sub