[SalesForce] Phone Number Validation

I need to write a validation rule for phone numbers to only start with 0 and be 11 digits long, no more, no less.

This is what I have so far below: At the moment, it is accepting 10 digits and I am able to save the record with only 10 digits. I need it to be 11 digits, no more, no less but I'm finding it difficult to correct it. Would really appreciate the help.

Many thanks

AND(
    OR(
        ISBLANK(Phone),
        NOT(REGEX(Phone, "^(0)[1-9]{1}([0-9]{8,9})$"))
    ),
    OR (
        Profile.Name = "Sales Agent",
        Profile.Name = "Field Sales Agent",
        Profile.Name = "Field Service Agent",
        Profile.Name = "Lead Gen Agent",
        Profile.Name = "TEL Sales Agent",
        Profile.Name = "THS Sales Agent"
    )
)

Best Answer

Just go low tech.

Add this to your OR statement: NOT(LEN(LastName) = 12)

Ie:

OR(     
        NOT(LEN(Phone) = 11),
        ISBLANK(Phone),
        NOT(REGEX(Phone, "^(0)[1-9]{1}([0-9]{8,9})$"))
    ),

This has the benefit of be a whole lot easier to read than the regex, which you can still use to validate other stuff.