Following is scenario.
I don't want to allow comma (,) in a string. For example 12,34 should return false and rest anything gives true.
I have read some tutorial to exclude some character using ^. As simple example I am doing something like this
You can change your regex and use anchors like this:
This pattern will match string where the line starts and ends with whatever string not having a comma
On the other hand, if you want to allow 12.34, 1234 or ABC patterns, then you could use: