Class: Zxcvbn::Matchers::Year Private
- Inherits:
-
Object
- Object
- Zxcvbn::Matchers::Year
- Includes:
- RegexHelpers
- Defined in:
- lib/zxcvbn/matchers/year.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Matches 4-digit year substrings (1900–2019) in the password.
Constant Summary collapse
- YEAR_REGEX =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Matches years from 1900 to 2019, matching zxcvbn.js v4.
/19\d\d|200\d|201\d/
Instance Method Summary collapse
-
#matches(password) ⇒ Array<MatchBuilder>
private
Matches with pattern “year”.
Methods included from RegexHelpers
Instance Method Details
#matches(password) ⇒ Array<MatchBuilder>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns matches with pattern “year”.
17 18 19 20 21 22 23 24 |
# File 'lib/zxcvbn/matchers/year.rb', line 17 def matches(password) result = [] re_match_all(YEAR_REGEX, password) do |match| match.pattern = 'year' result << match end result end |