Package org.passay

Class RepeatCharacterRegexRule

  • All Implemented Interfaces:
    Rule

    public class RepeatCharacterRegexRule
    extends IllegalRegexRule
    Rule for determining if a password contains a duplicate ASCII keyboard sequence. See Pattern /p{ASCII}. The default sequence length is 5 characters.
    • Sequences are of the form: 'bbbbb' or '#####'
    Author:
    Middleware Services
    • Field Detail

      • DEFAULT_SEQUENCE_LENGTH

        public static final int DEFAULT_SEQUENCE_LENGTH
        Default length of sequence, value is 5.
        See Also:
        Constant Field Values
      • MINIMUM_SEQUENCE_LENGTH

        public static final int MINIMUM_SEQUENCE_LENGTH
        Minimum length of sequence, value is 3.
        See Also:
        Constant Field Values
      • sequenceLength

        protected int sequenceLength
        Number of characters in sequence to match.
    • Constructor Detail

      • RepeatCharacterRegexRule

        public RepeatCharacterRegexRule()
        Creates a new repeat character regex rule with the default sequence length.
      • RepeatCharacterRegexRule

        public RepeatCharacterRegexRule​(int sl)
        Creates a new repeat character regex rule.
        Parameters:
        sl - sequence length
      • RepeatCharacterRegexRule

        public RepeatCharacterRegexRule​(int sl,
                                        boolean reportAll)
        Creates a new repeat character regex rule.
        Parameters:
        sl - sequence length
        reportAll - whether to report all matches or just the first
    • Method Detail

      • getSequenceLength

        public int getSequenceLength()
        Returns the sequence length for this rule.
        Returns:
        sequence length