I'm trying to write regular expression to restrict empty string and comma inside a string
example:
string = "" # not allowed
s = "ab c!@#)(*&^%$#~" # allowed
s = "sfsfsf,sdfsdf" # not allowed
The intention of this regexp is to do a pattern matching in swagger documentation like this property: type: string pattern: "^[0-9A-Za-z_]+$" value: type: object
I tried this regular expression ^(?!\s*$)[^,]*$
but it is not supported inside swagger doc and I get this error in golang code for this regular expression:
invalid or unsupported Perl syntax: `(?!