Error in regular matching

  node.js, question

Is there a regular match in the local file:
av: specific characters
1234567: seven random characters
.mp4: specific file format
Finally:av1234567.mp4
And:.*.cmt.xml

var a = new RegExp(/\bav\d{7}\.mp4\b/g)
 var b = new RegExp(/.*cmt\.xml/g)
fs.readdir(dirPath,function(err, files){
 if(err) console.log(err)
 var task = files.length
 var interval =  setInterval(function () {
 task--
 var file = files[task]
 Console.log(task plus':' plus a.test(file plus':' plus b.test(file));
 // if(a.test(file)){
 //   var mid = file.split(/.mp4/)[0]
 // var vdu = '/videos/' plus midplus'. mp4';
 //   console.log(mid);
 //   Movie.update({mid:mid},{$set:{video_url:vdu}},function(err){
 //     if(err) console.log(err);
 //   })
 // }else if(b.test(file)) {
 //   var title = file.split(/.cmt.xml/)[0]
 //   console.log(title);
 //   Movie.update({title:title},{$set:{xml:true}},function(err){
 //     if(err) console.log(err);
 //   })
 // }else {
 //   console.log('do nothing');
 // }
 if(task == 0) clearInterval(interval)
 }, 100);

图片描述

Matching result
 89
 88: Saipan Travel Work ~ Summer Smile at the Sea ~ [Puff's Eighth Work]
 87: [Abbe] Cherry Blossoms and Streams
 85: [Mitochondria] 39!  (I forgot to take the first anniversary of the cover photo as W
 83: [leader x Qin Xie] little fawn
 82: [Xiao Xin] 3 9❤Thank you sub-mirror plus full body position [BDF2016 house dance competition]
 80: [a circle of meat] little yellow song in hot weather
 78: 【SaIKa sin song] ~ blending ~ want to give you all the best wishes in the world (HB to blood EU)
 76: [N&M] Human Flesh Acceleration ~ Meteor Cluster 1.5 Times Speed
 75 : 【Lovelive!  ] [Trial Jump] Start Dash- Shunde No.1 Middle and High School Open Day 2016.5.7
 74 : av4646603
 72 : av4645947
 70 : av4645746
 68 : av4644450
 66 : av4644037
 64 : av4643963
 62 : av4643760
 60 : av4642458
 58 : av4640953
 56 : av4639766
 54 : av4639456
 52 : av4638661
 50 : av4638074
 48 : av4632440

I wonder if there is a more elegant way to handle local files.
There will be errors in the middle, and you can pass the test again by yourself. . .
It’s a little hard to find out why. . . Jiong

var a = new RegExp(/av[0-9]{7}\.mp4/i)
 var b = new RegExp(/*\.cmt\.xml/i)