Ask for a rule that can only be entered in uppercase letters and separated by commas?

if you have a question, you can only enter the regular format of "Chrme,Safari,Firefox".

Mar.29,2021

/ ^ ([Amurz] [a-z0-9] *,) * [Amurz] [a-z0-9] * $/

use examples

var reg = /^([A-Z][a-z0-9]*,)*[A-Z][a-z0-9]*$/;
if(reg.test(str)) {
    console.log('');
} else {
    console.log('');
}
Menu