In this code snippet, I am attempting to prevent a textfield from ending with any of the specified letters in the $scope.pointPattern variable.
$scope.pointPattern = /^(?!.*ess|ence|sports|riding?$)/;
$scope.error = "not valid";
Upon execution of the code, the error message is displayed only when the field ends with ess, while other endings are not considered invalid.
For example:
football ess > shows error as "not valid"
footbal ence > does not show error
sports or riding results do not trigger an error message
I'm unsure of what mistake I might be making. Can you provide guidance on this issue?