Skip to content

Commit

Permalink
fix regex
Browse files Browse the repository at this point in the history
Signed-off-by: xxs-wallace <[email protected]>
  • Loading branch information
xxs-wallace committed Aug 19, 2024
1 parent f31b314 commit 37f51a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ee/tabby-schema/src/schema/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lazy_static! {
pub static ref USERNAME_REGEX: Regex =
Regex::new(r"^[^0-9±!@£$%^&*_+§¡€#¢¶•ªº«\\/<>?:;|=.,]{2,20}$").unwrap();
pub static ref WEB_DOCUMENT_NAME_REGEX: Regex =
Regex::new(r"^[A-Za-z][A-Za-z0-9\ ]*$").unwrap();
Regex::new(r"^[A-Za-z][A-Za-z0-9]*(\ [A-Za-z0-9]+)*$").unwrap();
}

#[cfg(test)]
Expand Down Expand Up @@ -53,6 +53,7 @@ mod tests {
(" abc 123", false),
("abc123*", false),
("abc123_", false),
("abc 123", false), // two space
];

for (name, expected) in test_cases {
Expand Down

0 comments on commit 37f51a7

Please sign in to comment.