Skip to main content
Brenden Burkinshaw (Servicemax) a posé une question dans #REGEX

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

3 réponses
  1. 31 août 2021, 07:29

    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}$)"))

0/9000