I need to use this regular expression in a HTML input (taken from Regular expression for a list of items separated by comma or by comma and a space):
[^,\s][^\,]*[^,\s]*
So I set it in an input:
<input type="text" class="form-control" id="input" name="input" data-ng-model="myModel" pattern="[^,\s][^\,]*[^,\s]*">
But I get this error in console:
Pattern attribute value [^,\s][^\,]*[^,\s]* is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /[^,\s][^\,]*[^,\s]*/: Invalid escape
What is wrong with that regex?
I'm using Angular 1.5 BTW.