You need to sign in to do that
Don't have an account?
Jim Riggio 1
regex validation rule for special characters and length 24
Hello , i am trying to create a validation rule using REGEX, but can't seem to get it the correct way. I assume I am not using the function correctly.
I need to make sure the first two characters are AB or ab and the entire length of the string is 24 characters. I was successful in targeting the first two characters, but can't seem to determine the length. The remaining 22 characters can be any alphanumeric character including special characters. I don't know if I can do this with REGEX. I tried to use the combinations of BEGINS and LEN functions, but can't seem to get to work.
This is where I ended up with (but doesn't work)
NOT(REGEX(Test_ID__c, "^([Aa]?[Bb])+{22}$"))
I need to make sure the first two characters are AB or ab and the entire length of the string is 24 characters. I was successful in targeting the first two characters, but can't seem to determine the length. The remaining 22 characters can be any alphanumeric character including special characters. I don't know if I can do this with REGEX. I tried to use the combinations of BEGINS and LEN functions, but can't seem to get to work.
This is where I ended up with (but doesn't work)
NOT(REGEX(Test_ID__c, "^([Aa]?[Bb])+{22}$"))
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks
All Answers
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks
The regex I found onlne is NOT( REGEX(Custom_email_list__c , "([A-Za-z0-9]+([!#$%&'*+-/=?^_`{|}~]*[A-Za-z0-9]+)*@[A-Za-z0-9\\-]+(\\.[A-Za-z0-9\\-]+)*[ ]*[,;]?[ ]*)+" )) which works well but still works without a ; between email addresses
How do I ensure ; is present and if not it will throw the validation error?
Many thanks in advance