and more in a single search tool across platforms. Read the announcement here. |
11/02/2022 04:57 AM
Hello,
We are trying to create a regex expression for phone number validation which will match duplicate phone numbers regardless of the format. ex. : if a user has phone number +012345678 and new request is made for a user with phone number +01 234 5678 the regex should warn that this phone number is already in use by another user.
This is the original regex that we are currently using : ${PhoneNumber.matches('\\+[1-9]{1}[0-9\\s]*')}
Any help is much appreciated.
11/02/2022 11:12 PM - edited 11/03/2022 12:04 AM
Hi,
The regex is used for validating the format of the phone number. If you want to validate the phone number with or without spaces you can use this \+[1-9]{2}\s?[0-9]{3}\s?[0-9]{4}
Could you please elaborate your use case here.
Thanks and regards,
Jayasudha R
11/03/2022 03:48 AM
Hello,
I need to create a user that has the phone number ex. +33288991 and another person wants to create a user with the same number but with spaces between the number ex. +33 288 991 so in this case I want the application to say that the phone number is duplicated , that this phone number is already assigned to another user even if the phone number is with spaces between.
Thanks!
11/04/2022 12:29 AM
Hi,
1. You have to use the regex given to accept the phone number with or without spaces. \+[1-9]{2}\s?[0-9]{3}\s?[0-9]{4}
2.You need to remove spaces from the phone number if any.
3.You have to run a query to get the phone numbers from the database and match with the phone number from UI to avoid duplicates. This cannot be done via regex.
Regards,
Jayasudha R
11/07/2022 06:32 PM
You can handle above in Workflow using SQL query if above logic found auto reject request