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; 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;