Gistlib Logo

gistlib

buatkan regex email temporary in javascript

index.tsx
const temporaryEmailRegex = /^[a-zA-Z0-9_.+-]+@example\.com$/;

const email = "john_doe@example.com";
if (temporaryEmailRegex.test(email)) {
    console.log("Valid temporary email address");
} else {
    console.log("Invalid temporary email address");
}
254 chars
9 lines

similar javascript code snippets

remove emojis from a string in javascript
filter all words in an array that have a capital letter in javascript
find email addresses in a string using regex in javascript
get first word from a string in javascript
write a regex that matches "s, n" in javascript
replace the word "dog" with the word "cat" in the following sentence: "the quick brown fox jumps over the lazy dog." in javascript
find phone numbers in a string using regex in javascript
find zip codes in a string using regex in javascript
find email inside string with regex in javascript
use regex to find all links in javascript

related categories

regex
javascript

gistlibby LogSnag