const uuidPattern = /^[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}$/;
function isUuid(input){
if (uuidPattern.test(input)) {
return true;
}
}
How to check for a UUID in Javascript
Posted: | Categories: “tech"