1
1
mirror of https://github.com/renbaoshuo/S2OJ.git synced 2025-03-28 14:07:02 +00:00

fix: luogu problem id validator

This commit is contained in:
Baoshuo Ren 2023-02-03 15:04:34 +08:00
parent 94f31d0620
commit 1c0003a7e0
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

@ -77,9 +77,9 @@ function is_short_string($str) {
}
function validateCodeforcesProblemId($str) {
return preg_match('/(|GYM)[1-9][0-9]{0,5}[A-Z][1-9]?/', $str) !== true;
return preg_match('/^(|GYM)[1-9][0-9]{0,5}[A-Z][1-9]?$/', $str);
}
function validateLuoguProblemId($str) {
return preg_match('/P[1-9][0-9]{4,5}/', $str) !== true;
return preg_match('/^P[1-9][0-9]{3,5}$/', $str);
}