Hi All,
I need to enforce the structure of mobile phone number fields, I am almost there but cant figure out how to allow for a special character at the start.
Example Accepted Formats
+61 402 123 123 || 0402 123 123
Rule so Far
AND( NOT(MobilePhone ="") , LEN(MobilePhone) > 0 , NOT(REGEX( MobilePhone ,"(^614[0-9]{2}(| )[0-9]{3}(| )[0-9]{3}$)|(^04[0-9]{2}(| )[0-9]{3}(| )[0-9]{3}$)")))
Any help would be greatly appreciated.
Thanks,
Brenden
@Formulas - Help, Tips and Tricks #REGEX #Validation Formula
Hi Brenden ,
Try this
AND(
NOT(MobilePhone ="") ,
LEN(MobilePhone) > 0 ,
NOT(REGEX( MobilePhone ,"(^ [+] 614[0-9]{2}(| )[0-9]{3}(| )[0-9]{3}$)|(^04[0-9]{2}(| )[0-9]{3}(| )[0-9]{3}$)"))
)
Hi Brenden,
It may be better to use ISBLANK.
AND(
NOT(ISBLANK(MobilePhone)) ,
NOT(REGEX( MobilePhone ,"(^ [+] 614[0-9]{2}(| )[0-9]{3}(| )[0-9]{3}$)|(^04[0-9]{2}(| )[0-9]{3}(| )[0-9]{3}$)"))
)