mirror of
https://github.com/DerTyp7/explainegy-nextjs.git
synced 2025-10-28 20:32:14 +01:00
10 lines
325 B
TypeScript
10 lines
325 B
TypeScript
|
|
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);
|
|
} |