Comparing numbers with slight differences

Hello all,

I have made a process that will check if phone numbers are correct from 2 programmes.
The best case scenario is that someone wrote the phone number with the “-” in the appropriate place.
EG: 02-1234-5678
But some people do register the above as 0212345678
Lets say the variable for the one with “-” is A and the other one is B which may contain the “-” or not
How would I create the condition in the IF activity to see if just the numbers are the same?

Hi,

The following expression remove all character except number.

System.Text.RegularExpressions.Regex.Replace(strData,"[^\d]","")

So you can compare strA with strB as the following.

System.Text.RegularExpressions.Regex.Replace(strA,"[^\d]","")=System.Text.RegularExpressions.Regex.Replace(strB,"[^\d]","")

Regards,

the bottom expression can be used as the IF activity’s condition?

Hi
in IF condition mention this
expression once after getting the input from both the process named str1 and str2

System.Text.RegularExpressions.Regex.Replace(str1,"[\W]","").ToString.Equals(System.Text.RegularExpressions.Regex.Replace(str2,"[\W]",""))

Cheers @dvn

Yes. Can you try it?

FYI, this expression will work even if data contains other special character like +81-012(345)6789

Regards,