mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Fix pattern for domain
Because of the input pattern uses the v RegExp flag, ranges like [A-Za-z] must be wrapped with []. In addition, the last - in [A-Za-z0-9-] needed to be escaped.
This commit is contained in:
1 parent
381c23add2
commit
1e98d29523
1 file changed
+1
-1
@@ -16,7 +16,7 @@
|
||||
export let maxlength: number = null;
|
||||
|
||||
// https://www.geeksforgeeks.org/how-to-validate-a-domain-name-using-regular-expression/
|
||||
const pattern = String.raw`^(?!-)[A-Za-z0-9-]+([\-\.]{1}[a-z0-9]+)*\.[A-Za-z]{2,18}$`;
|
||||
const pattern = String.raw`(?!-)[A-Za-z0-9\-]+([\-\.]{1}[a-z0-9]+)*\.[A-Za-z]{2,18}`;
|
||||
|
||||
let element: HTMLInputElement;
|
||||
let error: string;
|
||||
|
||||
Reference in new issue
Block a user