var str = custom-FEB84A el-popup-parent--hidden帮我用正则匹配到custom-FEB84A
可以使用正则表达式 /custom-[A-Z0-9]+/ 来匹配到字符串 'custom-FEB84A'。
代码示例:
var str = 'custom-FEB84A el-popup-parent--hidden';
var regex = /custom-[A-Z0-9]+/;
var match = str.match(regex)[0];
console.log(match);
输出结果:
custom-FEB84A
原文地址: http://www.cveoy.top/t/topic/iDkI 著作权归作者所有。请勿转载和采集!