-
URL Shortener
{' '}
+
URL Shortener
{
name="URL"
/>
-
-
-
-
+ {showInputBox && (
+
+
+
+
+ )}
{showToast && (
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index d2d3595..e7ad8e6 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -1 +1,10 @@
export const alphanumicUnderscore = /^[a-zA-Z0-9_]+$/;
+export const urlRegex = new RegExp(
+ '^(https?:\\/\\/)?' + // protocol
+ '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
+ '((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
+ '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
+ '(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
+ '(\\#[-a-z\\d_]*)?$',
+ 'i'
+);