mirror of
https://github.com/DerTyp7/explainegy-nextjs.git
synced 2025-10-29 12:52:13 +01:00
cherry
This commit is contained in:
10
validators.ts
Normal file
10
validators.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
export function isValidText(text: string): boolean {
|
||||
const textRegex = /^[a-zA-Z\s\d\-_\(\)\[\]\{\}\!\@\#\$\%\^\&\*\+\=\,\.\?\/\\\|\'\":;]+$/;
|
||||
return textRegex.test(text) && text.length > 0;
|
||||
}
|
||||
|
||||
export function isValidName(name: string): boolean {
|
||||
const nameRegex = /^[a-zA-Z0-9\-_]+$/;
|
||||
return nameRegex.test(name);
|
||||
}
|
||||
Reference in New Issue
Block a user