11use once_cell:: sync:: Lazy ;
22use regex:: Regex ;
33
4- /// Regex pour valider les hash alphanumériques
4+ /// Regex for Hash alphanumerical
55pub static HASH_REGEX : Lazy < Regex > = Lazy :: new ( || Regex :: new ( r"^[a-zA-Z0-9]+$" ) . unwrap ( ) ) ;
6- /// Regex pour valider les emails
6+ /// Regex for Email
77pub static EMAIL_REGEX : Lazy < Regex > =
88 Lazy :: new ( || Regex :: new ( r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" ) . unwrap ( ) ) ;
99
10- /// Regex pour valider les noms d'utilisateur (alphanumériques + underscore)
10+ /// Regex for Username (alphanumerical + underscore)
1111pub static USERNAME_REGEX : Lazy < Regex > = Lazy :: new ( || Regex :: new ( r"^[a-zA-Z0-9_]+$" ) . unwrap ( ) ) ;
1212
13- /// Regex pour valider les UUIDs
13+ /// Regex for UUIDs
1414pub static UUID_REGEX : Lazy < Regex > = Lazy :: new ( || {
1515 Regex :: new ( r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" ) . unwrap ( )
1616} ) ;
1717
18- /// Regex pour valider les types de rating (etterna, osu, quaver, malody)
18+ /// Regex for Rating types (etterna, osu, quaver, malody)
1919pub static RATING_TYPE_REGEX : Lazy < Regex > =
2020 Lazy :: new ( || Regex :: new ( r"^(etterna|osu|quaver|malody)$" ) . unwrap ( ) ) ;
2121
@@ -24,3 +24,7 @@ pub static RANK_REGEX: Lazy<Regex> =
2424
2525pub static SCORE_STATUS_REGEX : Lazy < Regex > =
2626 Lazy :: new ( || Regex :: new ( r"^(pending|processing|validated|cheated|unsubmitted)$" ) . unwrap ( ) ) ;
27+
28+ /// Regex for Beatmap status (pending, ranked, qualified, loved, graveyard)
29+ pub static BEATMAP_STATUS_REGEX : Lazy < Regex > =
30+ Lazy :: new ( || Regex :: new ( r"^(pending|ranked|qualified|loved|graveyard)$" ) . unwrap ( ) ) ;
0 commit comments