I'm having trouble getting my code below to work properly. I'm not sure if the problem lies in the match function syntax or the regex itself. Any assistance would be greatly appreciated.
$scope.fileSelected = function (file) {
var valid = "/^[0-9a-zA-Z]+$/";
if (file.name.match(!valid)) {
alert("The file name contains characters that are not allowed (#, &, %, etc.)");
}
}