1Data::Password::zxcvbn:U:sMeartcCho:n:tRreigbeuxt(e3d)PDeartla:D:oPcausmsewnotradt:i:oznxcvbn::Match::Regex(3)
2
3
4
6 Data::Password::zxcvbn::Match::Regex - match class for recognisable
7 patterns in passwords
8
10 version 1.1.2
11
13 This class represents the guess that a certain substring of a password
14 can be guessed by enumerating small languages described by regular
15 expressions. By default, the only regex used is one that matches recent
16 years (yes, this is very similar to what "Date" does).
17
19 "regexes"
20 Hashref, the regular expressions that were tried to get this match. The
21 values are arrayrefs with 2 elements: the regex itself, and the
22 estimated number of guesses per character; for example:
23
24 digits => [ qr[(\p{Nd}+)], 10 ],
25
26 "regex_name"
27 The name of the regex that matched the token.
28
30 "make"
31 my @matches = @{ Data::Password::zxcvbn::Match::Regex->make(
32 $password,
33 { # this is the default
34 regexes => \%Data::Password::zxcvbn::Match::Regex::regexes_limited,
35 },
36 ) };
37
38 Scans the $password for substrings that match regexes in "regexes".
39
40 By default, the only regex that's used is one that matches recent years
41 expressed as 4 digits. More patterns are available as
42 "\%Data::Password::zxcvbn::Match::Regex::regexes" (which you can also
43 get if you say "regexes => 'all'"), or you can pass in your own
44 hashref.
45
46 "estimate_guesses"
47 For the "recent_year" regex, the number of guesses is the number of
48 years between the value represented by the token and a reference year
49 (currently 2017).
50
51 For all other regexes, the number of guesses is exponential on the
52 length of the token, using as base the second element of the matching
53 pattern (i.e. "$self->regexes->{$self->regex_name}[1]").
54
55 "feedback_warning"
56 "feedback_suggestions"
57 This class suggests not using recent years. At the moment, there's no
58 feedback for other regexes.
59
60 "fields_for_json"
61 The JSON serialisation for matches of this class will contain "token i
62 j guesses guesses_log10 regex_name".
63
65 Gianni Ceccarelli <gianni.ceccarelli@broadbean.com>
66
68 This software is copyright (c) 2022 by BroadBean UK, a CareerBuilder
69 Company.
70
71 This is free software; you can redistribute it and/or modify it under
72 the same terms as the Perl 5 programming language system itself.
73
74
75
76perl v5.38.0 2023-0D9a-t1a3::Password::zxcvbn::Match::Regex(3)