From 4c3a9e299e3f6d3f0d360b166b04c75b4484c0b7 Mon Sep 17 00:00:00 2001 From: Christian Abele Date: Wed, 29 May 2024 14:51:44 +0200 Subject: [PATCH 1/2] Update regex-validation.ts Fix email regex --- apps/docs/content/components/input/regex-validation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/content/components/input/regex-validation.ts b/apps/docs/content/components/input/regex-validation.ts index b3ce257e4f..1eb62d8e2b 100644 --- a/apps/docs/content/components/input/regex-validation.ts +++ b/apps/docs/content/components/input/regex-validation.ts @@ -3,7 +3,7 @@ const App = `import {Input} from "@nextui-org/react"; export default function App() { const [value, setValue] = React.useState("junior2nextui.org"); - const validateEmail = (value) => value.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$/i); + const validateEmail = (value) => value.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i); const isInvalid = React.useMemo(() => { if (value === "") return false; From c8183cae9825392936405cc243f2df60ca0fbb1c Mon Sep 17 00:00:00 2001 From: Christian Abele Date: Fri, 31 May 2024 10:14:46 +0200 Subject: [PATCH 2/2] Update email regex input.stories.tsx --- packages/components/input/stories/input.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/input/stories/input.stories.tsx b/packages/components/input/stories/input.stories.tsx index ef7e718a1b..b73dd0fcef 100644 --- a/packages/components/input/stories/input.stories.tsx +++ b/packages/components/input/stories/input.stories.tsx @@ -137,7 +137,7 @@ const PasswordTemplate = (args) => { const RegexValidationTemplate = (args) => { const [value, setValue] = React.useState(""); - const validateEmail = (value) => value.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$/i); + const validateEmail = (value) => value.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i); const validationState = React.useMemo(() => { if (value === "") return undefined;