programming-examples/js/Vre1/Check a given value contains alpha, dash and under.js
2019-11-15 12:59:38 +01:00

17 lines
329 B
JavaScript

function is_alphaDash(str)
{
regexp = /^[a-z0-9_\-]+$/i;
if (regexp.test(str))
{
return true;
}
else
{
return false;
}
}
console.log(is_alphaDash('12-133'));
console.log(is_alphaDash('100_23'));