let imgRegex = /(\jpg|\jpeg|\png|\gif|\webp)$/i;
let docRegex =
/(\zip|\doc|\pdf|\ppt|\pptx|\txt|\xls|\xlsx|\xlt|\xltx|\docx|\dwg\vsdx)$/;
let str = 'http://www.baidu.com/124.png'
console.log(docRegex.test(str) ) // true
12-17
1933