• Fried Eggs
  • NEWBIE
  • 10 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

I need to right a validation rule that allows certain phone number patterns but when I follow the pattern the rule still gets an error. Here's the Validation rule:

AND(
NOT(ISBLANK( Phone )),
NOT(
OR(
REGEX( Phone , "\\s*\\(\\d{3}\\)_\\d{3}-\\d{4}\\s*$"),
REGEX( Phone , "\\s*\\+?1_\\(\\d{3}\\)_\\d{3}-\\d{4}\\s*$"),
REGEX( Phone , "\\s*\\(\\d{3}\\)_\\d{3}-\\d{4}_x\\d+\\s*$"),
REGEX( Phone , "\\s*\\(\\d{3}\\)_\\d{3}-\\d{4}_Ext\\.\\d+\\s*$"),
REGEX( Phone , "\\s*\\(\\d{3}\\)_\\d{3}-\\d{4}_ext:\\d+\\s*$")
)
)
)
 

I need to right a validation rule that allows certain phone number patterns but when I follow the pattern the rule still gets an error. Here's the Validation rule:

AND(
NOT(ISBLANK( Phone )),
NOT(
OR(
REGEX( Phone , "\\s*\\(\\d{3}\\)_\\d{3}-\\d{4}\\s*$"),
REGEX( Phone , "\\s*\\+?1_\\(\\d{3}\\)_\\d{3}-\\d{4}\\s*$"),
REGEX( Phone , "\\s*\\(\\d{3}\\)_\\d{3}-\\d{4}_x\\d+\\s*$"),
REGEX( Phone , "\\s*\\(\\d{3}\\)_\\d{3}-\\d{4}_Ext\\.\\d+\\s*$"),
REGEX( Phone , "\\s*\\(\\d{3}\\)_\\d{3}-\\d{4}_ext:\\d+\\s*$")
)
)
)