programming-examples/js/Vre1/Check a given value contains alpha, dash and under.js

17 lines
329 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
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'));