I am struggling to come up with a regex pattern that restricts input strings from containing forward slashes, commas, or dots.
<form name="myForm">
<div class="col-sm-4">
<input class="form-control"
type="text"
data-ng-model="model_name"
name="modelName"
ng-pattern="/^[\/,.]/" required>
<div ng-messages="myForm.$submitted && myForm.modelName.$error" role="alert">
<div class="alert alert-danger" ng-message="pattern">Special characters [/ , .] are not allowed.</div>
<div class="alert alert-danger" ng-message="required">This field is required.</div>
</div>
</div>
</form>
Although the regular expression /^[\/,.]/
successfully identifies characters within the square brackets, it is causing issues when trying to enter normal strings like abc or abc_def. I lack expertise in regex and am unsure of how to resolve this issue. Any assistance would be greatly appreciated.