Update regex-validation.ts (#3123)

* Update regex-validation.ts

Fix email regex

* Update email regex input.stories.tsx
This commit is contained in:
Christian Abele 2024-06-15 02:02:25 +02:00 committed by GitHub
parent df0126f93f
commit 0e4213ce25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

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

View File

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