Validation rule to check consecutive characters in field

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite












I need to throw an error if there are three consecutive characters in field value.



like aaa,bbb,ccc,eee,AAA,BBB etc.



I am using below condition to check but dont think this is good solution.



OR(CONTAINS( FirstName ,"aaa" ),
CONTAINS( FirstName ,"bbb" ),
CONTAINS( FirstName ,"ccc" )


Could anyone please help










share|improve this question









New contributor




sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    up vote
    1
    down vote

    favorite












    I need to throw an error if there are three consecutive characters in field value.



    like aaa,bbb,ccc,eee,AAA,BBB etc.



    I am using below condition to check but dont think this is good solution.



    OR(CONTAINS( FirstName ,"aaa" ),
    CONTAINS( FirstName ,"bbb" ),
    CONTAINS( FirstName ,"ccc" )


    Could anyone please help










    share|improve this question









    New contributor




    sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I need to throw an error if there are three consecutive characters in field value.



      like aaa,bbb,ccc,eee,AAA,BBB etc.



      I am using below condition to check but dont think this is good solution.



      OR(CONTAINS( FirstName ,"aaa" ),
      CONTAINS( FirstName ,"bbb" ),
      CONTAINS( FirstName ,"ccc" )


      Could anyone please help










      share|improve this question









      New contributor




      sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I need to throw an error if there are three consecutive characters in field value.



      like aaa,bbb,ccc,eee,AAA,BBB etc.



      I am using below condition to check but dont think this is good solution.



      OR(CONTAINS( FirstName ,"aaa" ),
      CONTAINS( FirstName ,"bbb" ),
      CONTAINS( FirstName ,"ccc" )


      Could anyone please help







      apex validation validation-rule






      share|improve this question









      New contributor




      sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 1 hour ago









      Oleksandr Berehovskiy

      7,61511734




      7,61511734






      New contributor




      sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      sam

      83




      83




      New contributor




      sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote













          use REGEX validation formula. The following regex expression (w)11+ checks if there is 3 same word constituent characters in a row (case-insensitive). You can check this regex online here (nice service to play around with regex).



          Create validation rule with the following formula



          REGEX(FirstName, "(\w)\1\1+")





          share|improve this answer



























            up vote
            0
            down vote













            You can try to have Regex like this:



            REGEX(Name, '^([a-z])\1\1*')


            Not tested properly. Please test before use.






            share|improve this answer




















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "459"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );






              sam is a new contributor. Be nice, and check out our Code of Conduct.









               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f236314%2fvalidation-rule-to-check-consecutive-characters-in-field%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              3
              down vote













              use REGEX validation formula. The following regex expression (w)11+ checks if there is 3 same word constituent characters in a row (case-insensitive). You can check this regex online here (nice service to play around with regex).



              Create validation rule with the following formula



              REGEX(FirstName, "(\w)\1\1+")





              share|improve this answer
























                up vote
                3
                down vote













                use REGEX validation formula. The following regex expression (w)11+ checks if there is 3 same word constituent characters in a row (case-insensitive). You can check this regex online here (nice service to play around with regex).



                Create validation rule with the following formula



                REGEX(FirstName, "(\w)\1\1+")





                share|improve this answer






















                  up vote
                  3
                  down vote










                  up vote
                  3
                  down vote









                  use REGEX validation formula. The following regex expression (w)11+ checks if there is 3 same word constituent characters in a row (case-insensitive). You can check this regex online here (nice service to play around with regex).



                  Create validation rule with the following formula



                  REGEX(FirstName, "(\w)\1\1+")





                  share|improve this answer












                  use REGEX validation formula. The following regex expression (w)11+ checks if there is 3 same word constituent characters in a row (case-insensitive). You can check this regex online here (nice service to play around with regex).



                  Create validation rule with the following formula



                  REGEX(FirstName, "(\w)\1\1+")






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 46 mins ago









                  Oleksandr Berehovskiy

                  7,61511734




                  7,61511734






















                      up vote
                      0
                      down vote













                      You can try to have Regex like this:



                      REGEX(Name, '^([a-z])\1\1*')


                      Not tested properly. Please test before use.






                      share|improve this answer
























                        up vote
                        0
                        down vote













                        You can try to have Regex like this:



                        REGEX(Name, '^([a-z])\1\1*')


                        Not tested properly. Please test before use.






                        share|improve this answer






















                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          You can try to have Regex like this:



                          REGEX(Name, '^([a-z])\1\1*')


                          Not tested properly. Please test before use.






                          share|improve this answer












                          You can try to have Regex like this:



                          REGEX(Name, '^([a-z])\1\1*')


                          Not tested properly. Please test before use.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 55 mins ago









                          Ysr Shk

                          570523




                          570523




















                              sam is a new contributor. Be nice, and check out our Code of Conduct.









                               

                              draft saved


                              draft discarded


















                              sam is a new contributor. Be nice, and check out our Code of Conduct.












                              sam is a new contributor. Be nice, and check out our Code of Conduct.











                              sam is a new contributor. Be nice, and check out our Code of Conduct.













                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f236314%2fvalidation-rule-to-check-consecutive-characters-in-field%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              What does second last employer means? [closed]

                              List of Gilmore Girls characters

                              Confectionery