Regex to test for lowercase characters

Photo by Amador Loureiro on Unsplash
const isLowercaseOnly = (string) => {
const nonLowercaseLetters = /[^a-z]/g;
return !nonLowercaseLetters.test(string);
};
const isLowercaseOnly = (string) => {
const lowercaseOnly = /^[a-z]+$/g;
return lowercaseOnly.test(string);
}

After a decade in strategy for tech firms, I’m now an iOS developer! Looking for mentors on this journey :)

Welcome to Code Like A Girl, a space that celebrates redefining society's perceptions of women in technology. Share your story with us!