Class: Zxcvbn::Matchers::Digits

Inherits:
Object
  • Object
show all
Includes:
RegexHelpers
Defined in:
lib/zxcvbn/matchers/digits.rb

Constant Summary collapse

DIGITS_REGEX =
/\d{3,}/

Instance Method Summary collapse

Methods included from RegexHelpers

#re_match_all

Instance Method Details

#matches(password) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/zxcvbn/matchers/digits.rb', line 8

def matches(password)
  result = []
  re_match_all(DIGITS_REGEX, password) do |match|
    match.pattern = 'digits'
    result << match
  end
  result
end