Data::...:Regex(3pm)

✨ Hey bestie, it's the Data::Password::zxcvbn::Match::Regex page ✨

okay so real talk: this is a User Contributed Perl Documentation page for a Perl module called Data::Password::zxcvbn::Match::Regex (the header shortens it to Data::...:Regex(3pm) because terminals are dramatic like that πŸŽ€). It's part of the whole zxcvbn password-strength situation, and it's lowkey iconic if you're into guessing passwords the smart way. Let's get into it πŸ’…


πŸ’– NAME πŸ’–

Data::Password::zxcvbn::Match::Regex β€” it's the match class for recognisable patterns in passwords. Yes, that's the whole vibe. Periodt. ✨


🌸 VERSION 🌸

This bad boy is at version 1.1.3. She's thriving. πŸ¦‹


🧚 DESCRIPTION 🧚

So like, this class represents the guess that some substring of a password can be guessed by enumerating small languages described by regular expressions. Fancy way of saying: if your password is basically a pattern, we found you, bestie πŸ’€

By default, the only regex used is one that matches recent years β€” and yes, the docs literally say "yes, this is very similar to what Date does", so we're self-aware about it, no cap. πŸ™ˆ


πŸ’… ATTRIBUTES πŸ’…

✨ "regexes" ✨

A hashref, bestie. It holds the regular expressions that were tried to get this match. Each value is an arrayref with 2 elements: the regex itself, and the estimated number of guesses per character. For example:

digits => [ qr[(\p{Nd}+)], 10 ],

Two things in there, exactly like that. Don't come for me, that's what she said. πŸ“

✨ "regex_name" ✨

The name of the regex that matched the token. That's it, that's the attribute 🫢


πŸ‘‘ METHODS πŸ‘‘

🌈 "make" 🌈

my @matches = @{ Data::Password::zxcvbn::Match::Regex->make(
  $password,
  { # this is the default
    regexes => \%Data::Password::zxcvbn::Match::Regex::regexes_limited,
  },
) };

This scans the $password for substrings that match regexes in regexes. It's giving detective energy πŸ•΅οΈβ€β™€οΈ

By default, the only regex that's used is one that matches recent years expressed as 4 digits β€” that's the regexes_limited default, right there in the code block, exactly as written. More patterns are available as \%Data::Password::zxcvbn::Match::Regex::regexes β€” and plot twist β€” you can also get those if you say regexes => 'all'. Or, if you're feeling main character, you can pass in your own hashref. Your call, babe πŸ’–

πŸŽ€ "estimate_guesses" πŸŽ€

For the recent_year regex, the number of guesses is the number of years between the value represented by the token and a reference year β€” and that reference year is currently 2017. (Not me still thinking 2017 was three years ago 😭)

For all other regexes, the number of guesses is exponential on the length of the token, using as base the second element of the matching pattern, which is written exactly as:

$self->regexes->{$self->regex_name}[1]

So the math goes brrrr, and the base does the heavy lifting. ⭐

πŸ¦‹ "feedback_warning" πŸ¦‹

πŸ¦‹ "feedback_suggestions" πŸ¦‹

This class suggests not using recent years. That's the warning. At the moment, there's no feedback for other regexes β€” so like, don't expect extra notes from the other patterns, they're keeping it mysterious πŸ™ˆ

πŸ’œ "fields_for_json" πŸ’œ

The JSON serialisation for matches of this class will contain exactly these fields:

token i j guesses guesses_log10 regex_name

That's the whole roster, no additions, no subtractions. Slay ✨


🌟 AUTHOR 🌟

Gianni Ceccarelli <gianni.ceccarelli@broadbean.com> β€” icon, legend, the moment πŸ‘‘


This software is copyright (c) 2022 by BroadBean UK, a CareerBuilder Company.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. So like, go off, be free, just keep the same terms, bestie πŸ’–


ngl the whole thing is about catching passwords that are just years, so if your password is 2017… ma'am. We need to talk. πŸ’€

okay that's the whole page!! One last thing for the girlies who read footers: this was generated by perl v5.40.1 on 2025-10-17, and the manual name is the User Contributed Perl Documentation manual. Byeee, ily, go pick a better password πŸŒΈπŸ’…βœ¨

πŸ“¦ where this page comes from