@codacy/ui-components 0.67.66 → 0.67.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Input/hooks.js +1 -1
- package/package.json +1 -1
package/lib/Input/hooks.js
CHANGED
|
@@ -204,7 +204,7 @@ function generateRegexInputValidator(regex, errorMessage, inputType) {
|
|
|
204
204
|
}
|
|
205
205
|
export const useEmailInput = generateRegexInputValidator(
|
|
206
206
|
// Domains are limited to 2-64 characters according to https://emailregex.com
|
|
207
|
-
/^([a-zA-Z0-9_
|
|
207
|
+
/^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9_\-.]+)\.([a-zA-Z]{2,64})$/, 'Insert a valid email address', 'email');
|
|
208
208
|
export const useUrlInput = generateRegexInputValidator(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www\.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w\-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[.!/\\\w]*))?)/, 'Insert a valid URL', 'url');
|
|
209
209
|
export const useRegexInput = (regex, errorMessage, inputType) => {
|
|
210
210
|
return generateRegexInputValidator(regex, errorMessage, inputType);
|