The problem of regular expressions

var newsname;
ctrl.checkNameLegal = function () {
if (ctrl.fileName) {

var exports = /^(?![.])[\u4e00-\u9fa5_.a-zA-Z0-9]+$/ig;
if (exports.test(ctrl.fileName)) {
  newsname = ctrl.fileName;
} else {
  ctrl.fileName = newsname;
}

} else {

newsname = "";

}
};

this is written in an abnormal way. Is there any way to replace it with
ctrl.fileName = ctrl.fileName.replace (/.. / ig,"");

Thank you, God!


I don't know what to say.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e97809-47419.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e97809-47419.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?